Function: allocator_set_alloc_func_to_desc
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Sets the callback function for allocating memory blocks when the user-provided allocator is used.
Prototype
- C Prototype
1aclError aclrtAllocatorSetAllocFuncToDesc(aclrtAllocatorDesc allocatorDesc, aclrtAllocatorAllocFunc func)
- Python Function
1ret = acl.rt.allocator_set_alloc_func_to_desc(allocatorDesc, func)
Parameter Description
Parameter |
Description |
|---|---|
allocatorDesc |
Int, pointer address of the allocator descriptor. Call acl.rt.allocator_create_desc to set the allocator description in advance. |
func |
Callback function definition: def allocator_alloc_func(allocator, size):
pass
|
Return Value Description
Return Value |
Description |
|---|---|
ret |
Int, 0 on success; else, failure. |
Parent topic: aclrtAllocatorDesc