昇腾社区首页
中文
注册

UpdateGraphRefreshableFeatureMemoryBase

函数功能

用于更新除了Fixed之外可刷新的Feature内存基址。内存大小从GetCompiledGraphSummary>GetRefreshableFeatureMemorySize接口中获取。

先通过SetGraphFixedFeatureMemoryBase接口设置了Fixed Feature内存基地址,然后才能使用该接口。

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

函数原型

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

参数说明

参数名

输入/输出

描述

graph_id

输入

子图对应的id。

memory

输入

设置的除了Fixed之外可刷新的Feature内存基址。

size

输入

设置的除了Fixed之外可刷新的Feature内存大小。

返回值

参数名

类型

描述

-

Status

SUCCESS:设置成功。

FAILED:设置失败。

约束说明

  • 在调用本接口前,必须先调用CompileGraph接口进行图编译。
  • 调用CompileGraph完成图编译后,您可以通过GetCompiledGraphSummary接口获取Feature地址是否可刷新,只有Feature地址可刷新的图才支持重复调用本接口刷新Feature地址。
  • 该接口只适用于静态编译图,可以通过GetCompiledGraphSummary接口中的IsStatic接口获取图是否为静态编译。
  • 若使用了本接口,又配置了RegisterExternalAllocator接口, 则RegisterExternalAllocator接口不生效。

支持情况

Atlas 推理系列产品,支持

Atlas 训练系列产品,支持

Atlas A2训练系列产品/Atlas 800I A2推理产品,支持

Atlas 200/300/500 推理产品,不支持

Atlas 200I/500 A2推理产品,不支持