Skip to main content

cusparseGather

Function cusparseGather 

Source
pub unsafe extern "C" fn cusparseGather(
    handle: cusparseHandle_t,
    vecY: cusparseConstDnVecDescr_t,
    vecX: cusparseSpVecDescr_t,
) -> cusparseStatus_t
Expand description

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

In other words,

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

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

cusparseGather supports the following data types:

cusparseGather has the following constraints:

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

cusparseGather 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 the sparse vector vecX indices are distinct
  • The routine allows indices of vecX to be unsorted

cusparseGather supports the following optimizations:

  • CUDA graph capture
  • Hardware Memory Compression

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

ยงParameters

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