Typedef Qnn_GetTensorRawDataFn_t

Typedef Documentation

typedef Qnn_ErrorHandle_t (*Qnn_GetTensorRawDataFn_t)(Qnn_ContextHandle_t context, Qnn_GraphHandle_t graph, uint64_t id, Qnn_ClientBuffer_t *clientBuf)

A client-defined function used to obtain tensor data when the tensor memory type is QNN_TENSORMEMTYPE_RETRIEVE_RAW. Qnn_GetTensorRawDataRn_t may be called multiple times for the same tensor. Each call to Qnn_GetTensorRawDataRn_t must be accompanied by a call to Qnn_FreeTensorRawDataFn_t to free any allocated data for that tensor. It is not required that this function be thread safe, unless needed to support retrieval of tensor resources that may be shared between threads.

Param id

[in] The tensor ID.

Param context

[in] the context to which the tensor is associated

Param graph

[in] the graph to which the context is associated. For context tensors this field should be null.

Param clientBuf

[out] Pointer to the tensor’s client buffer.

Return

Error code:

  • QNN_SUCCESS: Client Buffer data successfully provided.

  • QNN_TENSOR_ERROR_DOES_NOT_EXIST: Tensor with id does not exist or was not created as QNN_TENSORMEMTYPE_RETRIEVE_RAW.

  • QNN_COMMON_ERROR_INVALID_ARGUMENT: clientBuf is NULL

  • QNN_COMMON_ERROR_RESOURCE_UNAVAILABLE: Requested tensor data cannot be allocated.