aclrtMemGetAllocationGranularity

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

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 for 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; otherwise, failure. For details, see aclError.

Restrictions

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

API Call Example

For the API call example, see Inter-Process Communication.