aclfvCreateSearchResult

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

Creates data of the aclfvSearchResult type as a search result. To destroy data of the aclfvSearchResult type, call aclfvDestroySearchResult.

Atlas inference accelerator module: This API is not supported.

Prototype

1
aclfvSearchResult *aclfvCreateSearchResult(uint32_t queryCnt, uint32_t *resultNum, uint32_t resultNumDataLen, uint32_t *id0, uint32_t *id1, uint32_t *resultOffset, float *resultDistance, uint32_t dataLen)

Parameters

Parameter

Input/Output

Description

queryCnt

Input

Number of search requests, fixed at 1 in 1:N mode.

resultNum

Input

Pointer to the number of results.

Number of search results.

resultNumDataLen

Input

Total memory size of resultNum.

id0

Input

Pointer to the repository 0 ID. The number of elements equals topK * queryCnt.

id1

Input

Pointer to the repository 1 ID. The number of elements equals topK * queryCnt.

resultOffset

Input

Offset pointer.

Offset of the repository corresponding to the search results of each search request. The number of elements equals topK * queryCnt.

resultDistance

Input

Pointer to the distance between each search result and the search request.

The number of elements equals topK * queryCnt.

dataLen

Input

Requested memory size: topK * queryCnt * 4 bytes.

Returns

  • Success: a pointer to data of the aclfvSearchResult type
  • Failure: nullptr