Skip to main content

cusparseRot

Function cusparseRot 

Source
pub unsafe extern "C" fn cusparseRot(
    handle: cusparseHandle_t,
    c_coeff: *const c_void,
    s_coeff: *const c_void,
    vecX: cusparseSpVecDescr_t,
    vecY: cusparseDnVecDescr_t,
) -> cusparseStatus_t
๐Ÿ‘ŽDeprecated
Expand description

The function computes the Givens rotation matrix

to a sparse vecX and a dense vector vecY

In other words,

for i=0 to nnz-1
Y\[X_indices[i\]] = c * Y\[X_indices[i\]] - s * X_values\[i\]
X_values\[i\]     = c * X_values\[i\]     + s * Y\[X_indices[i\]]

cusparseRot supports the following index type for representing the sparse vector vecX:

cusparseRot supports the following data types:

Uniform-precision computation:

X/Y/compute
cudaDataType_t::CUDA_R_32F
cudaDataType_t::CUDA_R_64F
cudaDataType_t::CUDA_C_32F
cudaDataType_t::CUDA_C_64F

Mixed-precision computation:

X/Ycompute
cudaDataType_t::CUDA_R_16FcudaDataType_t::CUDA_R_32F
cudaDataType_t::CUDA_R_16BF
cudaDataType_t::CUDA_C_16FcudaDataType_t::CUDA_C_32F[DEPRECATED]
cudaDataType_t::CUDA_C_16BF[DEPRECATED]

cusparseRot has the following constraints:

  • The arrays representing the sparse vector vecX must be aligned to 16 bytes

cusparseRot has the following properties:

  • The routine requires no extra storage
  • The routine supports asynchronous execution
  • Provides deterministic (bit-wise) results for each run if the sparse vector vecX indices are distinct

cusparseRot supports the following optimizations:

  • CUDA graph capture
  • Hardware Memory Compression

Please visit cuSPARSE Library Samples - cusparseRot for a code example.

ยงParameters

  • handle: Handle to the cuSPARSE library context.
  • c_coeff: cosine element of the rotation matrix.
  • s_coeff: sine element of the rotation matrix.
  • vecX: Sparse vector X.
  • vecY: Dense vector Y.