aclrtDeviceGetBareTgid

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function

Obtains the ID of the current process.

This API has been adapted to the physical machine and VM scenarios when obtaining the process ID. You only need to call it to obtain the process ID and then use it with other APIs (see aclrtMemExportToShareableHandle for details) to share the physical memory. If you obtain the process ID without calling this API, an exception may occur when you use the process ID.

Prototype

1
aclError aclrtDeviceGetBareTgid(int32_t *pid)

Parameters

Parameter

Input/Output

Description

pid

Output

Process ID.

Returns

0 on success; otherwise, failure. For details, see aclError.