我要评分
获取效率
正确性
完整性
易理解

krl_create_reorder_handle

Interface Definition

int krl_create_reorder_handle(KRLDistanceHandle** kdh, size_t accu_level, size_t full_accu_level, size_t codes_num, size_t dim, int metric_type, const uint8_t* codes, size_t codes_size);

Function

Initializes and constructs a KRLDistanceHandle instance for reordering computation.

Parameters

Parameter

Data Type

Description

Value Range

kdh

KRLDistanceHandle**

Pointer to the KRLDistanceHandle instance to be initialized.

It cannot be null and should point to a null pointer.

accu_level

size_t

Quantization level in low-accuracy coarse ordering.

[1, 3]

  • 1: int8
  • 2: fp16
  • 3: fp32

full_accu_level

size_t

Quantization level in high-accuracy reordering.

[1, 3]

  • 1: int8
  • 2: fp16
  • 3: fp32

codes_num

size_t

Number of base vectors computed for each query vector.

[1, 2^30 – 1]

dim

size_t

Vector dimension.

[1, 65535]

metric_type

int

Distance measurement type.

[0, 1]

  • 0: inner product distance
  • 1: Euclidean distance

codes

const uint8_t*

Base vectors (float).

The size is specified by codes_size.

codes_size

size_t

Length of base vectors.

codes_num x dim x 4

Return Values

Data Type

Description

int

0 is returned on successful execution. In case of failure, an error code is returned to indicate the specific issue: