aclrtMallocForTaskScheduler
Applicable Products
Product |
Supported |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function
Allocates the memory that can be used by the task scheduler on the AI processor.
Some operators in graph mode need to use the memory of this type.
Prototype
1 | aclError aclrtMallocForTaskScheduler(void **devPtr, size_t size, aclrtMemMallocPolicy policy, aclrtMallocConfig *cfg) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
devPtr |
Output |
Pointer to the pointer to the allocated device memory. |
size |
Input |
Memory size in bytes to allocate. size cannot be 0. |
policy |
Input |
Memory allocation policy. For details about the type definition, see aclrtMemMallocPolicy. If the configured memory allocation policy is beyond the value range of aclrtMemMallocPolicy, and size is greater than or equal to 2 MB, huge page memory is allocated; otherwise, common page memory is allocated. |
cfg |
Input |
Memory configuration. For details about the type definition, see aclrtMallocConfig. If no configuration is specified, NULL can be passed. |
Returns
0 on success; otherwise, failure. For details, see aclError.