RegisterExternalAllocator
Applicability
|
Product |
Supported or Not |
|---|---|
|
|
√ |
|
|
√ |
|
|
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 for 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 the "aclrtSynchronizeStream" API to synchronize the stream and ensure that tasks in the stream have been executed.
Parent topic: Session