aclrtMemGetAddressRange

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function

Obtains the start address and size of the memory block to which the address to be queried belongs.

Prototype

1
aclError aclrtMemGetAddressRange(void *ptr, void **pbase, size_t *psize)

Parameters

Parameter

Input/Output

Description

ptr

Input

Memory address to be queried.

pbase

Output

Start address of the memory block to which the address to be queried belongs.

psize

Output

Size of the memory block to which the address to be queried belongs, in bytes.

Returns

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

References

Scenario

aclrtMemGetAddressRange API Output

Querying the device memory returned by the aclrtMalloc or aclrtMallocWithCfg API

Start address and size of the memory block

Querying the host memory returned by the aclrtMallocHost or aclrtMallocHostWithCfg API

Start address and size of the memory block

Querying the virtual memory address mapped by the aclrtReserveMemAddress, aclrtMallocPhysical, or aclrtMapMem API

Start address and size of the mapped memory block