rocsparse_axpby Interface Reference#
hipfort_rocsparse::rocsparse_axpby Interface Reference
Scale a sparse vector and add it to a scaled dense vector. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_axpby_ (handle, alpha, x, beta, y) |
Detailed Description
Scale a sparse vector and add it to a scaled dense vector.
rocsparse_axpby multiplies the sparse vector \(x\) with scalar \(\alpha\) and adds the result to the dense vector \(y\) that is multiplied with scalar \(\beta\), such that
\[ y := \alpha \cdot x + \beta \cdot y \]
for(i = 0; i < size; ++i)
{
y[i] = beta * y[i]
}
for(i = 0; i < nnz; ++i)
{
y[x_ind[i]] += alpha * x_val[i]
}
rocsparse_axpby supports the following uniform-precision data types for the sparse and dense vectors x and y and compute types for the scalars \(\alpha\) and \(\beta\).
- Uniform Precisions:
-
Uniform Precisions X / Y / compute_type rocsparse_datatype_f32_r rocsparse_datatype_f64_r rocsparse_datatype_f32_c rocsparse_datatype_f64_c
- Mixed Precisions:
-
Mixed Precisions X / Y compute_type rocsparse_datatype_f16_r rocsparse_datatype_f32_r rocsparse_datatype_bf16_r rocsparse_datatype_f32_r
- Note
- This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
- This routine supports execution in a hipGraph context.
- This routine does not support batched computation.
- Parameters
-
[in] handle - handle to the rocSPARSE library context queue. [in] alpha - scalar \(\alpha\). [in] x - sparse matrix descriptor. [in] beta - scalar \(\beta\). [in,out] y - dense matrix descriptor.
- Return values
-
rocsparse_status_success the operation completed successfully. rocsparse_status_invalid_handle the library context was not initialized. rocsparse_status_invalid_pointer alpha,x,beta, orypointer is invalid.
- Example
Member Function/Subroutine Documentation
◆ rocsparse_axpby_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_axpby::rocsparse_axpby_ | ( | type(c_ptr), value | handle, |
| type(c_ptr), value | alpha, | ||
| type(c_ptr), value | x, | ||
| type(c_ptr), value | beta, | ||
| type(c_ptr), value | y | ||
| ) |
The documentation for this interface was generated from the following file: