aclrtMemSetPidToShareableHandle

Description

Sets the trustlist of processes that can share the memory. Only the processes configured with the trustlist can use shareableHandle exported by aclrtMemExportToShareableHandle.

This API must work with other APIs to implement memory sharing. For details, see the description of aclrtMemExportToShareableHandle.

Restrictions

  • This API is not supported in the Ascend RC form.

    Currently, the following models support the Ascend RC form:

    • Atlas 200/300/500 Inference Product
  • This API is used to set the process trustlist while calling the aclrtMemExportToShareableHandle API.

Prototype

aclError aclrtMemSetPidToShareableHandle(uint64_t shareableHandle, int32_t *pid, size_t pidNum)

Parameters

Parameter

Input/Output

Description

shareableHandle

Input

shareableHandle exported through the aclrtMemExportToShareableHandle API.

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 obtained. In the non-Docker scenario, the process ID is obtained.

pidNum

Input

Number of processes in the trustlist. The value must be the same as the size of the pid parameter array.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.