RegisterExternalAllocator
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
√ |
|
|
√ |
|
|
√ |
|
|
x |
|
|
√ |
|
|
√ |
Header File/Library File
- Header file: #include <ge/ge_api.h>
- Library file: libge_runner.so
Function Usage
Registers an external allocator to the GE. This applies to the scenario where the user's memory pool is used.
This API must be used together with LoadGraph, RunGraphWithStreamAsync, or ExecuteGraphWithStreamAsync and must be registered before LoadGraph is called.
Prototype
1
|
Status RegisterExternalAllocator(const void *const stream, AllocatorPtr allocator) const |
Parameters
Returns
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
Status |
SUCCESS: The setting is successful. FAILED: The setting fails. |
Restrictions
- For the same stream, if this API is called multiple times, the last registration is used.
- For different streams, if you use the same allocator, concurrent execution on multiple streams is not allowed. Before you execute the next stream, synchronize the previous one.
- Before the buffer is released by the allocator to the OS, call aclrtSynchronizeStream to synchronize the stream and make sure that tasks in the stream have been executed.