昇腾社区首页
中文
注册

AscendIndexGreat接口

API定义

AscendIndexGreat(const std::string& mode, const std::vector<int>& deviceList, bool verbose = false);

功能描述

AscendIndexGreat的构造函数,创建Ascend上的检索Index。

输入

const std::string& mode:指定算法模式。

const std::vector<int>& deviceList:指定的NPU 侧设备ID。

bool verbose:指定是否开启verbose选项,开启后部分操作提供额外的打印提示。默认值为“false”

输出

返回值

约束说明

  • mode:只支持“KMode”和“AKMode”两种模式。
  • deviceList:请使用npu-smi命令查询对应的NPUID,仅支持一个device设备ID。
  • 使用此构造函数创建Index实例后,需要先调用“LoadIndex”加载事先落盘后的index实例,然后再进行其他操作。

API定义

explicit AscendIndexGreat(const AscendIndexGreatInitParams& kModeInitParams);

功能描述

AscendIndexGreat的构造函数,创建Ascend上的检索Index。

输入

Index所需的初始化参数kModeInitParams,具体请参见AscendIndexGreatInitParams

输出

返回值

APP_ERROR:调用返回状态,具体请参见接口调用返回值参考

约束说明

参见AscendIndexGreatInitParams中的参数说明和参数约束。

API定义

AscendIndexGreat(const AscendIndexVstarInitParams& aModeInitParams, const AscendIndexGreatInitParams& kModeInitParams);

功能描述

AscendIndexGreat的构造函数,创建Ascend上的检索Index。

输入

Index所需的初始化参数aModeInitParams和kModeInitParams,具体请参见AscendIndexVstarInitParamsAscendIndexGreatInitParams

输出

返回值

APP_ERROR:调用返回状态,具体请参见接口调用返回值参考

约束说明

参考AscendIndexVstarInitParamsAscendIndexGreatInitParams中的参数说明和参数约束。

aModeInitParams和kModeInitParams的dim必须保持一致。

API定义

AscendIndexGreat(const AscendIndexGreat&) = delete;

功能描述

声明此index拷贝构造函数为空,即不可拷贝类型。

输入

const AscendIndexGreat&:常量AscendIndexGreat对象。

输出

返回值

约束说明