aclrtIpcMemImportByKey
Applicability
Product |
Supported |
|---|---|
√ |
|
√ |
|
☓ |
|
√ |
|
√ |
Description
Imports key information in the current process and returns the device memory address pointer that can be used by this process.
This API must work with other APIs to implement memory sharing. For details, see the description of aclrtIpcMemGetExportKey.
Prototype
aclError aclrtIpcMemImportByKey(void **devPtr, const char *key, uint64_t flags)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
devPtr |
Output |
Pointer to the device memory address. |
key |
Input |
Key of the shared memory. First call aclrtIpcMemGetExportKey to obtain the shared memory key and then pass it as an input. |
flags |
Input |
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 |
Returns
0 on success; else, failure. For details, see aclError.