RegisterExternalAllocator
Applicability
|
Product |
Supported or Not |
|---|---|
|
|
√ |
|
|
√ |
|
|
x |
|
|
√ |
|
|
√ |
Header File/Library File
- Header file: #include <ge/ge_api_v2.h>
- Library file: libge_runner_v2.so
Function Usage
Registers a user's 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 and RunGraphWithStreamAsync 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. |
Constraints
- 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" of acl to synchronize the stream and make sure that tasks in the stream have been executed.
Parent topic: GESession