UpdateGraphFeatureMemoryBase
Applicability
Product |
Supported or Not |
|---|---|
√ |
|
√ |
|
x |
|
√ |
|
√ |
Header File/Library File
- Header file: #include <ge/ge_api.h>
- Library file: libge_runner.so
Function Usage
Updates the feature memory base address of a graph.
The memory size is obtained from GetCompiledGraphSummary > GetFeatureMemorySize.
Feature memory refers to the intermediate memory required during model execution (for example, the input and output memories of intermediate nodes).
Prototype
1 | Status UpdateGraphFeatureMemoryBase(uint32_t graph_id, const void *const memory, size_t size) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
graph_id |
Input |
Subgraph ID. |
memory |
Input |
Base address of the feature memory. |
size |
Input |
Size of the feature memory. |
Returns
Parameter |
Type |
Description |
|---|---|---|
- |
Status |
SUCCESS: The setting is successful. FAILED: The setting fails. |
Restrictions
- Before calling this API, you must call CompileGraph to compile the graph.
- After compiling a graph by calling CompileGraph, you can call GetCompiledGraphSummary to check whether the feature address can be updated. Only graphs whose feature addresses can be updated can call this API again to updated the feature addresses.
- This API applies only to statically compiled graphs. You can call the IsStatic API in GetCompiledGraphSummary to check whether a graph is statically compiled.
- If this API is used and RegisterExternalAllocator is configured, RegisterExternalAllocator does not take effect.
- This API cannot be used together with SetGraphFixedFeatureMemoryBase or SetGraphFixedFeatureMemoryBaseWithType with the input parameter MEMORY_TYPE_DEFAULT.
- This API cannot be called along with UpdateGraphRefreshableFeatureMemoryBase.
Parent topic: Session