aclrtMemGetAccess

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 memory access permission.

Prototype

1
aclError aclrtMemGetAccess(void *virPtr, aclrtMemLocation *location, uint64_t *flag)

Parameters

Parameter

Input/Output

Description

virPtr

Input

Start address of the virtual memory.

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

location

Input

Memory location. For details about the type definition, see aclrtMemLocation.

Currently, aclrtMemLocation.type can only be set to ACL_MEM_LOCATION_TYPE_HOST or ACL_MEM_LOCATION_TYPE_DEVICE. If aclrtMemLocation.type is set to ACL_MEM_LOCATION_TYPE_HOST, aclrtMemLocation.id is invalid and can be fixed at 0.

flag

Output

Memory access protection flag.

Returns

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