Function: mem_get_allocation_granularity
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
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.
Prototype
- C Prototype
1aclError aclrtMemGetAllocationGranularity(aclrtPhysicalMemProp *prop, aclrtMemGranularityOptions option, size_t *granularity)
- Python Function
1granularity, ret = acl.rt.mem_get_allocation_granularity(prop, option)
Parameter Description
Parameter |
Description |
|---|---|
prop |
Dict, physical memory attributes. For details, see aclrtPhysicalMemProp. |
option |
Int, minimum or recommended granularity. For details, see aclrtMemGranularityOptions. |
Return Value Description
Return Value |
Description |
|---|---|
granularity |
Int, memory allocation granularity, in bytes. Currently, only 2 MB is supported. |
ret |
Int, error code: 0 on success; else, failure. |
Restrictions
This API is not supported in the Ascend RC form.