aclfvInit

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

X

Atlas A3 training products/Atlas A3 inference products

X

Atlas A2 training products/Atlas A2 inference products

X

Atlas 200I/500 A2 inference products

X

Atlas inference products

√

Atlas training products

X

Function

Initializes the feature search module. aclfvInit can be called only once in a process, and must be used in pair with aclfvRelease.

The feature vector search function depends on the header file in the ${INSTALL_DIR}/include/acl/ops/acl_fv.h directory and the library file in the ${INSTALL_DIR}/lib64/libacl_retr.so directory. Replace ${INSTALL_DIR} with the CANN component directory. For example, if the installation is performed by the root user, the default file storage path is /usr/local/Ascend/cann.

Atlas inference accelerator module: This API is not supported.

Prototype

1
aclError aclfvInit(aclfvInitPara *initPara)

Parameters

Parameter

Input/Output

Description

initPara

Input

Pointer to the initialization parameters for feature vector search. For the type definition, see aclfvInitPara.

  • Call aclfvCreateInitPara to create data of the aclfvInitPara type in advance.
  • In 1:N mode, call aclfvSet1NTopNum to set the maximum number of results (topK) to return. If it is not set, top 4800 results are returned by default.
  • In N:M mode, call aclfvSetNMTopNum to set the maximum number of results (topK) to return. If it is not set, top 500 results are returned by default.

Returns

0 on success; otherwise, failure. For details, see aclError.