Skip to main content

cusparseSpVV

Function cusparseSpVV 

Source
pub unsafe extern "C" fn cusparseSpVV(
    handle: cusparseHandle_t,
    opX: cusparseOperation_t,
    vecX: cusparseConstSpVecDescr_t,
    vecY: cusparseConstDnVecDescr_t,
    result: *mut c_void,
    computeType: cudaDataType,
    externalBuffer: *mut c_void,
) -> cusparseStatus_t
๐Ÿ‘ŽDeprecated
Expand description

The function computes the inner dot product of a sparse vector vecX and a dense vector vecY

In other words, $$ \operatorname{op}(X) = \begin{cases} X & \text{if } op(X) = \text{CUSPARSE_OPERATION_NON_TRANSPOSE} \ X & \text{if } op(X) = \text{CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{cases} $$

The function cusparseSpVV_bufferSize returns the size of the workspace needed by cusparseSpVV

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

The data types combinations currently supported for cusparseSpVV are listed below:

Uniform-precision computation:

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

Mixed-precision computation:

X/YcomputeType/resultNotes
cudaDataType_t::CUDA_R_8IcudaDataType_t::CUDA_R_32I
cudaDataType_t::CUDA_R_8IcudaDataType_t::CUDA_R_32F
cudaDataType_t::CUDA_R_16FcudaDataType_t::CUDA_R_32F
cudaDataType_t::CUDA_R_16BFcudaDataType_t::CUDA_R_32F
cudaDataType_t::CUDA_C_16FcudaDataType_t::CUDA_C_32F[DEPRECATED]
cudaDataType_t::CUDA_C_16BFcudaDataType_t::CUDA_C_32F[DEPRECATED]

cusparseSpVV has the following constraints:

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

cusparseSpVV 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
  • The routine allows indices of vecX to be unsorted

cusparseSpVV supports the following optimizations:

  • CUDA graph capture
  • Hardware Memory Compression

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

ยงParameters

  • handle: Handle to the cuSPARSE library context.
  • opX: Operation op(X) that is non-transpose or conjugate transpose.
  • vecX: Sparse vector X.
  • vecY: Dense vector Y.
  • result: The resulting dot product.
  • computeType: Datatype in which the computation is executed.
  • externalBuffer: Pointer to a workspace buffer of at least bufferSize bytes.