rocsparse_rot Interface Reference#
hipfort_rocsparse::rocsparse_rot Interface Reference
Apply Givens rotation to a dense and a sparse vector. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_rot_ (handle, c, s, x, y) |
Detailed Description
Apply Givens rotation to a dense and a sparse vector.
rocsparse_rot applies the Givens rotation matrix \(G\) to the sparse vector \(x\) and the dense vector \(y\), where
\[ G = \begin{pmatrix} c & s \\ -s & c \end{pmatrix} \]
for(i = 0; i < nnz; ++i)
{
x_tmp = x_val[i];
y_tmp = y[x_ind[i]];
x_val[i] = c * x_tmp + s * y_tmp;
y[x_ind[i]] = c * y_tmp - s * x_tmp;
}
rocsparse_rot supports the following uniform-precision data types for the sparse and dense vectors x and y and compute types for the scalars \(c\) and \(s\).
- Uniform Precisions:
-
Uniform Precisions X / Y / compute_type rocsparse_datatype_f32_r rocsparse_datatype_f64_r rocsparse_datatype_f32_c rocsparse_datatype_f64_c
- 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] c - pointer to the cosine element of \(G\), which can be on host or device. [in] s - pointer to the sine element of \(G\), which can be on host or device. [in,out] x - sparse vector \(x\). [in,out] y - dense vector \(y\).
- Return values
-
rocsparse_status_success the operation completed successfully. rocsparse_status_invalid_handle the library context was not initialized. rocsparse_status_invalid_pointer c,s,x, orypointer is invalid.
- Example
Member Function/Subroutine Documentation
◆ rocsparse_rot_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_rot::rocsparse_rot_ | ( | type(c_ptr), value | handle, |
| type(c_ptr), value | c, | ||
| type(c_ptr), value | s, | ||
| type(c_ptr), value | x, | ||
| type(c_ptr), value | y | ||
| ) |
The documentation for this interface was generated from the following file: