跳到主要内容

AscendStream

GetDynamicGearInfo

函数功能

获得模型支持的动态输入档位信息,支持动态Batch、动态分辨率和分档动态维度模型。

函数原型

std::vector<std::vector<uint64_t>> GetDynamicGearInfo()

返回参数说明

数据结构说明
std::vector<std::vector<uint64_t>>模型支持的输入Tensor档位信息。
- **std::vector<std::vector<uint64_t>>**为所有档位信息。
- **std::vector<uint64_t>**为某一档的具体值。
返回数据结构为空,表示获取分档信息失败或者模型不属于函数功能中描述的三种模型之一,具体的原因可查看报错信息确认。 例如,模型为动态分辨率模型,**std::vector<uint64_t>**为某一档的高、宽值。

父主题: Model

公共参数

参数名数据类型参数说明
streamvoid*Stream对应的指针,默认值为“nullptr”。
isDefaultbool声明当前创建的Stream是否为默认Stream,默认值为“false”(即非默认)。

父主题: AscendStream

AscendStream

函数功能

AscendStream类的构造函数。

函数原型

explicit AscendStream(int32_t deviceId = 0);

参数说明

参数名输入/输出说明
deviceId输入指定Stream对应的设备ID。

父主题: AscendStream

~AscendStream

函数功能

AscendStream类的默认析构函数。

函数原型

~AscendStream();

父主题: AscendStream

CreateAscendStream

函数功能

在当前进程或线程中创建一个Stream,同步接口。

  • Atlas 200I/500 A2 推理产品暂不支持。

函数原型

APP_ERROR CreateAscendStream();

返回参数说明

数据结构说明
APP_ERROR程序执行返回的错误码,请参考APP_ERROR说明

父主题: AscendStream

DestroyAscendStream

函数功能

销毁一个Stream。

函数原型

APP_ERROR DestroyAscendStream();

返回参数说明

数据结构说明
APP_ERROR程序执行返回的错误码,请参考APP_ERROR说明

父主题: AscendStream

在线提单