文档
注册

SetGraphFixedFeatureMemoryBase

函数功能

用于指定图的Fixed Feature内存基地址,内存大小从GetCompiledGraphSummary>GetFixedFeatureMemorySize接口中获取。

Feature内存指的是模型执行过程中所需要的中间内存(比如中间节点的输入输出等内存)

  • 当图中包含Fixed内存,但是用户未指定时,默认申请Fixed内存。
  • 用户可以通过将地址设置为nullptr,size设置为0的方式,关闭默认申请Fixed内存的行为。

函数原型

Status SetGraphFixedFeatureMemoryBase(uint32_t graph_id, const void * const memory, size_t size);

参数说明

参数名

输入/输出

描述

graph_id

输入

子图对应的id。

memory

输入

设置的Fixed Feature内存基地址。

size

输入

设置的Fixed Feature内存大小。

返回值

参数名

类型

描述

-

Status

SUCCESS:设置成功。

FAILED:设置失败。

约束说明

  • 在调用本接口前,必须先调用CompileGraph接口进行图编译。
  • 每个graph只支持设置一次,不支持刷新。
  • 不能与UpdateGraphFeatureMemoryBase接口同时使用。
  • 不能与SetGraphFixedFeatureMemoryBaseWithType接口同时使用,SetGraphFixedFeatureMemoryBaseWithType用来设置不同内存类型的的Fixed内存基址;而SetGraphFixedFeatureMemoryBase用来设置Fixed内存基址和大小。
  • 当Fixed内存长度为0时,调用该接口不生效,且会生成warning日志提示用户。
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词