Function: create_search_result

Description

Creates data of the aclfvSearchResult type as a search result.

To destroy data of the aclfvSearchResult type, call Function: destroy_search_result.

The Atlas inference accelerator module of the Atlas inference product does not support this API.

Prototype

  • C 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)
    
  • Python Function
    1
    search_result = acl.fv.create_search_result(query_cnt, result_num, result_num_data_len, id_0, id_1, result_offset, result_distance, data_len)
    

Parameters

Parameter

Description

query_cnt

Int, number of query requests, fixed at 1 in 1:N mode

result_num

Int, number of results of each query request.

result_num_data_len

Int, total memory size of resultNum

id_0

Int, repository 0 ID. The number of elements equals topK * queryCnt.

id_1

Int, repository 1 ID. The number of elements equals topK * queryCnt.

result_offset

Int, offset pointer.

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

result_distance

Int, distance between each search result and the search request. The total number is topK x queryCnt.

data_len

Int, requested memory size: topK * queryCnt * 4 bytes

Return Value

Return Value

Description

search_result

Int, pointer address.

  • Success: data of the aclfvSearchResult type.
  • Failure: 0.

Reference

For details about the API call sequence and sample code, see Feature Vector Search.