rocsparse_sroti Interface Reference#
hipfort_rocsparse::rocsparse_sroti Interface Reference
Apply Givens rotation to a dense and a sparse vector. More...
Public Member Functions | |
| integer(kind(rocsparse_status_success)) function | rocsparse_sroti_ (handle, nnz, x_val, x_ind, y, c, s, idx_base) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sroti_rank_0 (handle, nnz, x_val, x_ind, y, c, s, idx_base) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sroti_rank_1 (handle, nnz, x_val, x_ind, y, c, s, idx_base) |
Detailed Description
Apply Givens rotation to a dense and a sparse vector.
rocsparse_roti 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;
}
- 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.
- Parameters
-
[in] handle - handle to the rocSPARSE library context queue. [in] nnz - number of non-zero entries of \(x\). [in,out] x_val - array of nnzelements containing the non-zero values of \(x\).[in] x_ind - array of nnzelements containing the indices of the non-zero values of \(x\).[in,out] y - array of values in dense format. [in] c - pointer to the cosine element of \(G\), can be on the host or device. [in] s - pointer to the sine element of \(G\), can be on the host or device. [in] idx_base - rocsparse_index_base_zeroorrocsparse_index_base_one.
- Return values
-
rocsparse_status_success the operation completed successfully. rocsparse_status_invalid_handle the library context was not initialized. rocsparse_status_invalid_value idx_baseis invalid.rocsparse_status_invalid_size nnzis invalid.rocsparse_status_invalid_pointer c,s,x_val,x_ind, orypointer is invalid.
- Example
Member Function/Subroutine Documentation
◆ rocsparse_sroti_()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sroti::rocsparse_sroti_ | ( | type(c_ptr), value | handle, |
| integer(c_int), value | nnz, | ||
| type(c_ptr), value | x_val, | ||
| type(c_ptr), value | x_ind, | ||
| type(c_ptr), value | y, | ||
| real(c_float) | c, | ||
| real(c_float) | s, | ||
| integer(kind(rocsparse_index_base_zero)), value | idx_base | ||
| ) |
◆ rocsparse_sroti_rank_0()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sroti::rocsparse_sroti_rank_0 | ( | type(c_ptr) | handle, |
| integer(c_int) | nnz, | ||
| real(c_float), target | x_val, | ||
| integer(c_int), target | x_ind, | ||
| real(c_float), target | y, | ||
| real(c_float) | c, | ||
| real(c_float) | s, | ||
| integer(kind(rocsparse_index_base_zero)) | idx_base | ||
| ) |
◆ rocsparse_sroti_rank_1()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sroti::rocsparse_sroti_rank_1 | ( | type(c_ptr) | handle, |
| integer(c_int) | nnz, | ||
| real(c_float), dimension(:), target | x_val, | ||
| integer(c_int), dimension(:), target | x_ind, | ||
| real(c_float), dimension(:), target | y, | ||
| real(c_float) | c, | ||
| real(c_float) | s, | ||
| integer(kind(rocsparse_index_base_zero)) | idx_base | ||
| ) |
The documentation for this interface was generated from the following file: