aclrtMemGetAllocationGranularity

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

Description

Queries the memory allocation granularity.

The system internally calculates the minimum granularity or recommended granularity based on the memory attribute information specified by the user and returns the granularity using the granularity parameter. This granularity can be used as a multiple of alignment, address size, or address mapping.

Prototype

1
aclError aclrtMemGetAllocationGranularity(aclrtPhysicalMemProp *prop, aclrtMemGranularityOptions option, size_t *granularity)

Parameters

Parameter

Input/Output

Description

prop

Input

Physical memory attribute information. For details about the type definition, see aclrtPhysicalMemProp.

option

Input

Minimum granularity or recommended granularity. For details about the type definition, see aclrtMemGranularityOptions.

granularity

Output

Memory allocation granularity, in bytes.

Returns

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

Restrictions

This API is not supported in the Ascend RC form of the Atlas 200I/500 A2 inference product .

API Call Example

For the API call example, see Interprocess communication.