Skip to main content

cusparseScatter

Function cusparseScatter 

Source
pub unsafe extern "C" fn cusparseScatter(
    handle: cusparseHandle_t,
    vecX: cusparseConstSpVecDescr_t,
    vecY: cusparseDnVecDescr_t,
) -> cusparseStatus_t
Expand description

The function scatters the elements of the sparse vector vecX into the dense vector vecY

In other words,

for i=0 to nnz-1
Y\[X_indices[i\]] = X_values\[i\]

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

cusparseScatter supports the following data types:

X/Y
cudaDataType_t::CUDA_R_8I
cudaDataType_t::CUDA_R_16F
cudaDataType_t::CUDA_R_16BF
cudaDataType_t::CUDA_R_32F
cudaDataType_t::CUDA_R_64F
cudaDataType_t::CUDA_C_16F [DEPRECATED]
cudaDataType_t::CUDA_C_16BF [DEPRECATED]
cudaDataType_t::CUDA_C_32F
cudaDataType_t::CUDA_C_64F

cusparseScatter has the following constraints:

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

cusparseScatter 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

cusparseScatter supports the following optimizations:

  • CUDA graph capture
  • Hardware Memory Compression

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

ยงParameters

  • handle: Handle to the cuSPARSE library context.
  • vecX: Sparse vector X.
  • vecY: Dense vector Y.