Function nvcvTensorWrapDataConstruct

Function Documentation

NVCVStatus nvcvTensorWrapDataConstruct(const NVCVTensorData *data, NVCVTensorDataCleanupFunc cleanup, void *ctxCleanup, NVCVTensorHandle *handle)

Wraps an existing tensor buffer into an NVCV tensor instance constructed in given storage

It allows for interoperation of external tensor representations with NVCV.

Parameters:
  • data[in] Tensor contents.

  • cleanup[in] Cleanup function to be called when the tensor is destroyed via nvcvTensorDecRef. If NULL, no cleanup function is defined.

  • ctxCleanup[in] Pointer to be passed unchanged to the cleanup function, if defined.

  • handle[out] Where the tensor instance handle will be written to.

    • Must not be NULL.

Return values:
  • NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside valid range.

  • NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the tensor.

  • NVCV_SUCCESS – Operation executed successfully.