PvaAllocator#
Functions#
- NVCVStatus nvcvAllocatorConstructPva(NVCVAllocatorHandle *handle)
Constructs an allocator instance in the given storage.
- NVCVStatus nvcvImageCalcRequirementsPva(int32_t width, int32_t height, NVCVImageFormat format, int32_t baseAddrAlignment, int32_t rowAddrAlignment, NVCVImageRequirements *reqs)
Calculates the resource requirements needed to create a tensor with given shape.
- NVCVStatus nvcvTensorCalcRequirementsPva(int32_t rank, const int64_t *shape, NVCVDataType dtype, NVCVTensorLayout layout, int32_t baseAddrAlignment, int32_t rowAddrAlignment, NVCVTensorRequirements *reqs)
Calculates the resource requirements needed to create a tensor with given shape.
Functions#
-
NVCVStatus nvcvAllocatorConstructPva(NVCVAllocatorHandle *handle)#
Constructs an allocator instance in the given storage.
When not needed anymore, the allocator instance must be destroyed by nvcvAllocatorDecRef function.
- Parameters:
handle – [out] Where new instance handle will be written to.
Must not be NULL.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Some argument is outside its valid range.
NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the allocator.
NVCV_SUCCESS – Allocator created successfully.
- NVCVStatus nvcvImageCalcRequirementsPva(
- int32_t width,
- int32_t height,
- NVCVImageFormat format,
- int32_t baseAddrAlignment,
- int32_t rowAddrAlignment,
- NVCVImageRequirements *reqs,
Calculates the resource requirements needed to create a tensor with given shape.
- Parameters:
width, height – [in] Image dimensions.
Width and height must be > 0.
format – [in] Image format.
Must not be NVCV_IMAGE_FORMAT_NONE.
baseAddrAlignment – [in] Alignment, in bytes, of the requested memory buffer. Currently, only a value of 0 is supported, which means buffers will be allocated using the default PVA memory alignment.
rowAddrAlignment – [in] Alignment, in bytes, of each image’s row address. In other words, (rowAddr - baseAddr) % rowAddrAlignment == 0. If 0, use a default suitable for optimized memory access. The used alignment is at least the given value. Pass 1 for fully packed rows, i.e., no padding at the end of each row.
If different from 0, it must be a power-of-two.
reqs – [out] Where the image requirements will be written to.
Must not be NULL.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside valid range.
NVCV_SUCCESS – Operation executed successfully.
- NVCVStatus nvcvTensorCalcRequirementsPva(
- int32_t rank,
- const int64_t *shape,
- NVCVDataType dtype,
- NVCVTensorLayout layout,
- int32_t baseAddrAlignment,
- int32_t rowAddrAlignment,
- NVCVTensorRequirements *reqs,
Calculates the resource requirements needed to create a tensor with given shape.
- Parameters:
rank – [in] Rank of the tensor (its number of dimensions).
shape – [in] Pointer to array with tensor shape. It must contain at least ‘rank’ elements.
dtype – [in] Type of tensor’s elements.
layout – [in] Tensor layout. Pass NVCV_TENSOR_NONE is layout is not available.
Layout rank must be
rank
.
baseAddrAlignment – [in] Alignment, in bytes, of the requested memory buffer. Currently, only a value of 0 is supported, which means buffers will be allocated using the default PVA memory alignment.
rowAddrAlignment – [in] Alignment, in bytes, of the start of each second-to-last dimension address with respect to the base address. In other words, (rowAddr - baseAddr) % rowAddrAlignment == 0. If 0, use a default suitable for optimized memory access. The used alignment is at least the given value. Pass 1 for creation of fully packed tensors, i.e., no padding between dimensions.
If different from 0, it must be a power-of-two.
reqs – [out] Where the tensor requirements will be written to.
Must not be NULL.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside valid range.
NVCV_SUCCESS – Operation executed successfully.