BatchSVD#
Functions#
- NVCVStatus pvaBatchSVDCreate(NVCVOperatorHandle *handle, const NVCVTensorRequirements *srcParams)
Constructs an instance of the BatchSVD operator.
- NVCVStatus pvaBatchSVDSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, const NVCVTensorHandle src, const NVCVTensorHandle U, const NVCVTensorHandle S, const NVCVTensorHandle V, const int32_t maxIters, const float tol)
Executes the BatchSVD operation.
Functions#
- NVCVStatus pvaBatchSVDCreate(
- NVCVOperatorHandle *handle,
- const NVCVTensorRequirements *srcParams,
Constructs an instance of the BatchSVD operator.
Limitations:
Data Layout: [HWC] C: Number of matrices H: Matrix height W: Matrix width Due to VMEM capacity, max matrix width = 31 The formula for memory constraint on matrix width and height is: width * height * PITCH * 2 + (width + 1) * BATCH) > 1024 * 128 (128KB one VMEM superbank) PITCH and BATCH are set to 16, as defined in batch_svd_params.h Per matrix SVD: A = USV^T, economy SVD A and U size: H x W, H >= W >= 2 S size: 1 x W, W >= 2, H = 1 V size: W x W, W >= 2, H = W Please note that the S output is not in a diagonal matrix format. Instead, it is a vector containing W singular values. Data Type | Allowed -------------- | ------------- 8bit Unsigned | No 8bit Signed | No 16bit Unsigned | No 16bit Signed | No 32bit Unsigned | No 32bit Signed | No 32bit Float | Yes 64bit Float | No
- Parameters:
handle – [out] Where the operator instance handle will be written to.
Must not be NULL.
srcParams – [in] Pointer to the NVCVTensorRequirements structure which contains input matrices tensor rank, shape, layout and data type information.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Handle is null.
NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the operator.
NVCV_SUCCESS – Operation executed successfully.
- NVCVStatus pvaBatchSVDSubmit(
- NVCVOperatorHandle handle,
- cupvaStream_t stream,
- const NVCVTensorHandle src,
- const NVCVTensorHandle U,
- const NVCVTensorHandle S,
- const NVCVTensorHandle V,
- const int32_t maxIters,
- const float tol,
Executes the BatchSVD operation.
- Parameters:
handle – [in] Handle to the operator.
Must not be NULL.
stream – [in] Handle to a valid CUPVA stream.
src – [in] Input matrix tensor handle. Data Type: NVCV_DATA_TYPE_F32 Data Layout: [HWC]
U – [out] Output U matrix tensor handle. Data Type: NVCV_DATA_TYPE_F32 Data Layout: [HWC]
S – [out] Output S matrix tensor handle. Data Type: NVCV_DATA_TYPE_F32 Data Layout: [HWC]
V – [out] Output V matrix tensor handle. Data Type: NVCV_DATA_TYPE_F32 Data Layout: [HWC]
maxIters – [in] The process of Jacobi rotations stops after maxIters sweeps.
tol – [in] Converge criterion to check if the off-diagonal elements are sufficiently small compared to the diagonal elements. Note that if the value is less than 1e-7f, convergence may not occur until the maximum number of iterations is reached.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Some parameter is outside the valid range.
NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.
NVCV_SUCCESS – Operation executed successfully.