index_cpu_to_ascend

API definition

faiss::Index *index_cpu_to_ascend(std::initializer_list<int> devices, const faiss::Index *index, const AscendClonerOptions *options = nullptr);

Function

Copies and generates a retrieval index on the Ascend based on the retrieval index resources on the CPU.

Input

std::initializer_list<int> devices: device ID to be configured on the NPU.

const faiss::Index *index: retrieval index resources on the CPU.

const AscendClonerOptions *options = nullptr: AscendClonerOptions resources to be configured.

Output

N/A

Return value

Retrieval index generated on the Ascend.

Restrictions

  • After using the index, delete the pointer to destroy the corresponding space.
  • The value of devices must be a valid and unique device ID. The maximum number of device IDs is 64.
  • index must be a valid CPU Index pointer.

API definition

faiss::Index *index_cpu_to_ascend(std::vector<int> devices, const faiss::Index *index, const AscendClonerOptions *options = nullptr);

Function

Copies and generates a retrieval index on the Ascend based on the retrieval index resources on the CPU.

Input

std::vector<int> devices: device ID to be configured on the NPU.

const faiss::Index *index: retrieval index resources on the CPU.

const AscendClonerOptions *options = nullptr: AscendClonerOptions resources to be configured.

Output

N/A

Return value

Retrieval index generated on the Ascend.

Restrictions

  • After using the index, delete the pointer to destroy the corresponding space.
  • The value of devices must be a valid and unique device ID. The maximum number of device IDs is 64.
  • index must be a valid CPU Index pointer.