pub unsafe extern "C" fn cusparseAxpby(
handle: cusparseHandle_t,
alpha: *const c_void,
vecX: cusparseConstSpVecDescr_t,
beta: *const c_void,
vecY: cusparseDnVecDescr_t,
) -> cusparseStatus_t๐Deprecated
Expand description
The function computes the sum of a sparse vector vecX and a dense vector vecY.
In other words,
for i=0 to n-1
Y\[i\] = beta * Y\[i\]
for i=0 to nnz-1
Y\[X_indices[i\]] += alpha * X_values\[i\]cusparseAxpby 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)
cusparseAxpby 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/Y | compute | |
|---|---|---|
cudaDataType_t::CUDA_R_16F | cudaDataType_t::CUDA_R_32F | |
cudaDataType_t::CUDA_R_16BF | ||
cudaDataType_t::CUDA_C_16F | cudaDataType_t::CUDA_C_32F | [DEPRECATED] |
cudaDataType_t::CUDA_C_16BF | [DEPRECATED] |
cusparseAxpby has the following constraints:
- The arrays representing the sparse vector
vecXmust be aligned to 16 bytes
cusparseAxpby 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
cusparseAxpby supports the following optimizations:
- CUDA graph capture
- Hardware Memory Compression
Please visit cuSPARSE Library Samples - cusparseAxpby for a code example.
ยงParameters
handle: Handle to the cuSPARSE library context.alpha: $\alpha$ scalar used for multiplication of compute type.vecX: Sparse vectorX.beta: $\beta$ scalar used for multiplication of compute type.vecY: Dense vectorY.