Function: ipc_mem_import_by_key
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
x |
Description
Obtains the key information in the current process and returns the device memory address pointer that can be used by the current process. This API must work with other APIs to implement memory sharing. For details, see the description of Function: ipc_mem_get_export_key.
Prototype
- C Prototype
aclError aclrtIpcMemImportByKey(void **devPtr, const char *key, uint64_t flag)
- Python Function
1dev_ptr, ret = acl.rt.ipc_mem_import_by_key(key, flags)
Parameters
Parameter |
Description |
|---|---|
key |
Str, shared memory key. |
flags |
Whether to enable data exchange between two devices. The value can be either of the following macros:
The macros are defined as follows: #define ACL_RT_IPC_MEM_IMPORT_FLAG_DEFAULT 0x0UL #define ACL_RT_IPC_MEM_IMPORT_FLAG_ENABLE_PEER_ACCESS 0x1UL |
Return Value
Return Value |
Description |
|---|---|
dev_ptr |
int, pointer to the device memory address. |
ret |
Int, error code. 0 on success; else, failure. |