SetGraphConstMemoryBase
产品支持情况
| 产品 | 是否支持 | 
|---|---|
| √ | |
| √ | |
| x | |
| √ | |
| √ | |
| x | 
函数原型
| 1 | Status SetGraphConstMemoryBase(uint32_t graph_id, const void *const memory, size_t size) | 
参数说明
| 参数名 | 输入/输出 | 说明 | 
|---|---|---|
| graph_id | 输入 | 子图对应的ID。 | 
| memory | 输入 | 设置的const内存基地址。 | 
| size | 输入 | 设置的const内存大小。 | 
返回值说明
| 参数名 | 类型 | 说明 | 
|---|---|---|
| - | Status | SUCCESS:设置成功。 FAILED:设置失败。 | 
约束说明
- 在调用本接口前,必须先调用CompileGraph接口进行图编译。
- 每个Graph只支持设置一次,不支持刷新。
- 该接口只适用于静态编译图,可以通过GetCompiledGraphSummary接口中的IsStatic接口获取图是否为静态编译。
- 若使用了本接口,又配置了RegisterExternalAllocator接口,则RegisterExternalAllocator接口不生效。
父主题: Session API