Function: search

Applicability

Product

Supported (√/x)

Atlas A3 training products / Atlas A3 inference products

x

Atlas A2 training products / Atlas A2 inference products

x

Atlas training products

x

Atlas inference products

Atlas 200I/500 A2 inference products

x

Function Usage

Performs 1:N or N:M feature search.

The Atlas inference accelerator modules in the Atlas inference products does not support this API.

Prototype

  • C Prototype
    1
    aclError aclfvSearch(aclfvSearchType type, aclfvSearchInput *searchInput, aclfvSearchResult *searchRst)
    
  • Python Function
    1
    ret = acl.fv.search(type, search_input, search_result)
    

Parameter Description

Parameter

Description

type

Int, feature description. For details, see aclfvSearchType.

search_input

  • Int, address of the pointer that points to search input.

    Call acl.fv.create_search_input to create data of the aclfvSearchInput type in advance.

search_result

  • Int, address of the pointer that points to the search output.

    Call acl.fv.create_search_result to create data of the aclfvSearchResult type in advance. The queryCnt argument must be the same as that of searchInput.

    The number of returned search results is specified by the topK argument passed to the acl.fv.create_search_input call and is also restricted by the maximum value of topK specified by the acl.fv.init call for initialization. If the topK argument passed to the acl.fv.create_search_input call is greater than or equal to that passed to the acl.fv.init call, the maximum number set in the acl.fv.init call takes precedence; otherwise, the topK argument passed to the acl.fv.create_search_input call applies.

Return Value Description

Return Value

Description

ret

Int, error code.

Restrictions

  • In N:M mode, multithreaded adding, search, or deletion is not allowed.
  • In 1:N or N:M mode, if no repository is added, zero results are returned by the acl.fv.search call.
  • This API call automatically creates a stream for synchronous task execution within the API. When the tasks are complete, the stream is automatically destroyed.

    Hardware has restrictions on the total number of streams. For details, see Function: create_stream.

Reference

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