aclrtMemRetainAllocationHandle

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 handle to the physical memory based on the virtual memory address.

If this API is called multiple times, you need to call aclrtFreePhysical the same number of times to free the physical memory handle.

If ACL_ERROR_RT_FEATURE_NOT_SUPPORT is returned, the underlying driver does not support this feature. You need to upgrade the driver package to 26.0.RC1 or later. You can click here to download the driver installation package of the required version on the Firmware & Drivers page and install and upgrade the driver by referring to the corresponding document.

Prototype

1
aclError aclrtMemRetainAllocationHandle(void* virPtr, aclrtDrvMemHandle *handle)

Parameters

Parameter

Input/Output

Description

virPtr

Input

Pointer to the pointer to the allocated virtual memory address.

The value must be the same as the value of virPtr in the aclrtMapMem API.

handle

Output

Handle for storing physical memory information. For details about the type definition, see aclrtDrvMemHandle.

Returns

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

Restrictions

Atlas 200I/500 A2 inference products in Ascend RC form: This API is not supported.