Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
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.
1 | aclError aclrtMallocForTaskScheduler(void **devPtr, size_t size, aclrtMemMallocPolicy policy, aclrtMallocConfig *cfg) |
1 | dev_ptr, ret = acl.rt.malloc_for_task_scheduler(size, policy, cfg) |
Parameter |
Description |
|---|---|
size |
Int, allocated memory size, in bytes. Must not be 0. |
policy |
Int, memory allocation policy. If the configured memory allocation rule exceeds the value range of aclrtMemMallocPolicy and size is greater than or equal to 2 MB, memory is allocated based on huge pages. Otherwise, memory is allocated based on normal pages. |
cfg |
Dict, memory configuration. If no configuration is specified, an empty dictionary can be transferred. For details, see aclrtMallocConfig. |
Return Value |
Description |
|---|---|
devPtr |
Int, address of the pointer to the allocated device memory. |
ret |
Int, error code. 0 on success; else, failure. |