aclrtMemGetAllocationGranularity

Description

Queries the memory allocation granularity. The system internally calculates the minimum granularity or recommended granularity for a given allocation specification and returns the granularity using the granularity parameter. This granularity can be used as a multiple of alignment, address size, or address mapping.

Restrictions

This API is not supported in the Ascend RC form.

Currently, the following models support the Ascend RC form:

  • Atlas 200/300/500 Inference Product

Prototype

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

Parameters

Parameter

Input/Output

Description

prop

Input

Physical memory attribute information.

option

Input

Minimum granularity or recommended granularity.

granularity

Output

Memory allocation granularity, in bytes.

Currently, only 2M is supported.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.