Rate This Document
Findability
Accuracy
Completeness
Readability

krl_inner_product_ny_with_handle

Interface Definition

int krl_inner_product_ny_with_handle(const KRLDistanceHandle* krl_distance_handle, float* dis, const float* x, size_t dis_size, size_t x_size);

Function

Performs one-to-many distance computation using inner product on vectors represented in float precision. The base vectors and dimensions are stored in the handle.

Parameters

Parameter

Data Type

Description

Value Range

kdh

const KRLDistanceHandle*

Pointer to a KRLDistanceHandle instance.

It cannot be null, and is initialized using krl_create_distance_handle.

dis

float*

Stores the distance computation result.

The size is specified by dis_size. The memory needs to be allocated in advance.

x

const uint8_t*

Query vector for distance computation.

The size is specified by x_size.

dis_size

size_t

Size of the distance result array.

The size is specified by num_base x codes_num, where num_base is the number of query vectors processed in a single batch, and codes_num is the number of base vectors each query vector is compared against.

x_size

size_t

Specifies the size of the query vector array.

The size is specified by d x num_base, where d is the vector dimension.

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: