pub unsafe extern "C" fn cusparseGather(
handle: cusparseHandle_t,
vecY: cusparseConstDnVecDescr_t,
vecX: cusparseSpVecDescr_t,
) -> cusparseStatus_tExpand 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:
- 32-bit indices (
cusparseIndexType_t::CUSPARSE_INDEX_32I) - 64-bit indices (
cusparseIndexType_t::CUSPARSE_INDEX_64I)
cusparseGather supports the following data types:
X/Y |
|---|
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 |
cusparseGather has the following constraints:
- The arrays representing the sparse vector
vecXmust 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 sparse vector
vecXindices are distinct - The routine allows
indicesofvecXto 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 vectorY.vecX: Sparse vectorX.