Function nvcvTensorConstruct

Function Documentation

NVCVStatus nvcvTensorConstruct(const NVCVTensorRequirements *reqs, NVCVAllocatorHandle alloc, NVCVTensorHandle *handle)

Constructs a tensor instance with given requirements in the given storage.

Parameters:
  • reqs[in] Tensor requirements. Must have been filled by one of the nvcvTensorCalcRequirements functions.

    • Must not be NULL

  • alloc[in] Allocator to be used to allocate needed memory buffers. The following resources are used:

    • cuda memory If NULL, it’ll use the internal default allocator.

    • Allocator must not be destroyed while an tensor still refers to it.

  • 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 instance.

  • NVCV_SUCCESS – Operation executed successfully.