aclrtMemSetPidToShareableHandleV2
Applicable Products
Product |
Supported |
|---|---|
√ |
|
☓ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function
Sets the trustlist of processes that can share memory.
This API is enhanced based on aclrtMemSetPidToShareableHandle. You can use the shareType parameter to specify whether to export a shareableHandle within an AI server or from another AI server.
The usage of this API is similar to that of aclrtMemExportToShareableHandle. However, this API must be used together with aclrtMemExportToShareableHandleV2 to export a shareableHandle and with aclrtMemImportFromShareableHandleV2 to import a shareableHandle.
Prototype
1 | aclError aclrtMemSetPidToShareableHandleV2(void *shareableHandle, aclrtMemSharedHandleType shareType, int32_t *pid, size_t pidNum) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
shareableHandle |
Input |
A shareableHandle exported using the aclrtMemExportToShareableHandleV2 API. It is a pointer that points to the shareableHandle. |
shareType |
Input |
Type of the exported shareableHandle. For details about the type definition, see aclrtMemSharedHandleType. |
pid |
Input |
Array for storing trustlisted process IDs. You can call aclrtDeviceGetBareTgid to obtain the process ID. In the Docker scenario, the process ID on the physical machine is returned. In non-Docker scenarios, the process ID is returned. |
pidNum |
Input |
Number of processes in the trustlist. The value must be the same as the size of the pid array. |
Returns
0 on success; otherwise, failure. For details, see aclError.