Function nvcvAllocatorFreeCudaMemory

Function Documentation

NVCVStatus nvcvAllocatorFreeCudaMemory(NVCVAllocatorHandle halloc, void *ptr, int64_t sizeBytes, int32_t alignBytes)

Frees a cuda-accessible memory buffer.

It’s usually used when implementing operators.

Parameters:
  • halloc[in] Handle to the memory allocator object to be used.

    • Must have been created by nvcvAllocatorCreate.

  • memType[in] Type of memory to be freed.

  • ptr[in] Pointer to the memory buffer to be freed. It can be NULL. In this case, no operation is performed.

  • sizeBytes, alignBytes[in] Parameters passed during buffer allocation.

    • Not passing the exact same parameters passed during allocation will lead to undefined behavior.

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

  • NVCV_SUCCESS – Operation completed successfully.