hipsparsesroti Interface Reference

hipsparsesroti Interface Reference#

HIPFORT API Reference: hipfort_hipsparse::hipsparsesroti Interface Reference
hipfort_hipsparse::hipsparsesroti Interface Reference

Apply the Givens rotation to a dense and a sparse vector. More...

Public Member Functions

integer(kind(hipsparse_status_success)) function hipsparsesroti_ (handle, nnz, xval, xind, y, c, s, idxbase)
 
integer(kind(hipsparse_status_success)) function hipsparsesroti_rank_0 (handle, nnz, xval, xind, y, c, s, idxbase)
 
integer(kind(hipsparse_status_success)) function hipsparsesroti_rank_1 (handle, nnz, xval, xind, y, c, s, idxbase)
 

Detailed Description

Apply the Givens rotation to a dense and a sparse vector.

hipsparseXroti 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 = xVal[i];
y_tmp = y[xInd[i]];
xVal[i] = c * x_tmp + s * y_tmp;
y[xInd[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.
If nnz is zero, the function returns successfully without modifying xVal or y.
Deprecated:
This function is deprecated when using the CUDA backend (CUDA 11.0+) and will be removed in CUDA 12.0. This deprecation does not apply to the ROCm backend.
Parameters
[in]handle- handle to the hipSPARSE library context queue.
[in]nnz- number of non-zero entries of \(x\). Must be non-negative.
[in,out]xVal- array of nnz elements containing the non-zero values of \(x\).
[in]xInd- array of nnz elements containing the indices of the non-zero values of \(x\).
[in,out]y- array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd.
[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]idxBase- index base. HIPSPARSE_INDEX_BASE_ZERO for zero-based indexing or HIPSPARSE_INDEX_BASE_ONE for one-based indexing.
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_NOT_INITIALIZEDhandle is not initialized.
HIPSPARSE_STATUS_INVALID_VALUEhandle, c, or s is nullptr, nnz is negative, xVal, xInd, or y is nullptr when nnz is greater than zero, or idxBase is neither HIPSPARSE_INDEX_BASE_ZERO nor HIPSPARSE_INDEX_BASE_ONE.

Member Function/Subroutine Documentation

◆ hipsparsesroti_()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesroti::hipsparsesroti_ ( type(c_ptr), value  handle,
integer(c_int), value  nnz,
type(c_ptr), value  xval,
type(c_ptr), value  xind,
type(c_ptr), value  y,
real(c_float)  c,
real(c_float)  s,
integer(kind(hipsparse_index_base_zero)), value  idxbase 
)

◆ hipsparsesroti_rank_0()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesroti::hipsparsesroti_rank_0 ( type(c_ptr)  handle,
integer(c_int)  nnz,
real(c_float), target  xval,
integer(c_int), target  xind,
real(c_float), target  y,
real(c_float)  c,
real(c_float)  s,
integer(kind(hipsparse_index_base_zero))  idxbase 
)

◆ hipsparsesroti_rank_1()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesroti::hipsparsesroti_rank_1 ( type(c_ptr)  handle,
integer(c_int)  nnz,
real(c_float), dimension(:), target  xval,
integer(c_int), dimension(:), target  xind,
real(c_float), dimension(:), target  y,
real(c_float)  c,
real(c_float)  s,
integer(kind(hipsparse_index_base_zero))  idxbase 
)

The documentation for this interface was generated from the following file: