AscendIndexBinaryFlatConfig

AscendIndexBinaryFlat needs to use the corresponding AscendIndexBinaryFlatConfig to initialize the related resources, and configure the hardware resource devices and preset memory pool size resources during retrieval.

  • AscendIndexBinaryFlat supports only the Atlas inference product powered by a single Ascend AI Processor and depends on the AICPU operator and BinaryFlat operator. For details about how to generate the corresponding operator, see Custom Operator.
  • AscendIndexBinaryFlat supports only the standard-form deployment.

Member Description

Member

Type

Description

deviceList

std::vector<int>

Device ID

The AscendIndexBinaryFlat class supports only the accelerator card on a single Atlas inference product.

resourceSize

int64_t

Size of the memory pool on the device, in bytes. The default value is 1024 MB. The value range is [1024 × 1024 × 1024, 32 × 1024 × 1024 × 1024]. You are advised to allocate 5 GB for a database with 10 million records.

API Description

API definition

AscendIndexBinaryFlatConfig() = default;

Function

Default constructor. The default value of devices is 0, indicating the 0th Ascend AI Processor is used for computing. The default value of resources is 1024 MB.

Input

N/A

Output

N/A

Return value

N/A

Restrictions

AscendIndexBinaryFlat supports only the Atlas inference product on a single Ascend AI Processor. If the 0th Ascend AI Processor is unavailable, the default constructor cannot be used.

API definition

AscendIndexBinaryFlatConfig(std::initializer_list<int> devices, int64_t resources = BINARY_FLAT_DEFAULT_MEM);

Function

devices uses the constructor of initializer_list.

Input

std::initializer_list<int> devices: device ID. Only a single device is supported, that is, the length of devices is 1.

int64_t resources: preset memory pool size. The default value is 1024 MB.

Output

N/A

Return value

N/A

Restrictions

  • The value of devices must be a valid and unique device ID. The length is 1.
  • The valid value range of resources is [1024 × 1024 × 1024, 32 × 1024 × 1024 × 1024]. You are advised to allocate 5 GB for a database with 10 million records.

API definition

AscendIndexBinaryFlatConfig(std::vector<int> devices, int64_t resources = BINARY_FLAT_DEFAULT_MEM);

Function

devices uses the constructor of vector.

Input

std::vector<int> devices: device ID. Only a single device is supported, that is, the length of devices is 1.

int64_t resources: preset memory pool size. The default value is 1024 MB.

Output

N/A

Return value

N/A

Restrictions

  • The value of devices must be a valid and unique device ID. The length is 1.
  • The valid value range of resources is [1024 × 1024 × 1024, 32 × 1024 × 1024 × 1024]. You are advised to allocate 5 GB for a database with 10 million records.