hipsparsescsrmv Interface Reference

hipsparsescsrmv Interface Reference#

HIPFORT API Reference: hipfort_hipsparse::hipsparsescsrmv Interface Reference
hipfort_hipsparse::hipsparsescsrmv Interface Reference

Sparse matrix vector multiplication using the CSR storage format. More...

Public Member Functions

integer(kind(hipsparse_status_success)) function hipsparsescsrmv_ (handle, transa, m, n, nnz, alpha, descra, csrsortedvala, csrsortedrowptra, csrsortedcolinda, x, beta, y)
 
integer(kind(hipsparse_status_success)) function hipsparsescsrmv_rank_0 (handle, transa, m, n, nnz, alpha, descra, csrsortedvala, csrsortedrowptra, csrsortedcolinda, x, beta, y)
 
integer(kind(hipsparse_status_success)) function hipsparsescsrmv_rank_1 (handle, transa, m, n, nnz, alpha, descra, csrsortedvala, csrsortedrowptra, csrsortedcolinda, x, beta, y)
 

Detailed Description

Sparse matrix vector multiplication using the CSR storage format.

hipsparseXcsrmv multiplies the scalar \(\alpha\) with a sparse \(m \times n\) matrix, defined in CSR storage format, and the dense vector \(x\) and adds the result to the dense vector \(y\) that is multiplied by the scalar \(\beta\), such that

\[ y := \alpha \cdot op(A) \cdot x + \beta \cdot y, \]

with

\[ op(A) = \left\{ \begin{array}{ll} A, & \text{if transA == HIPSPARSE_OPERATION_NON_TRANSPOSE} \\% A^T, & \text{if transA == HIPSPARSE_OPERATION_TRANSPOSE} \\% A^H, & \text{if transA == HIPSPARSE_OPERATION_CONJUGATE_TRANSPOSE} \end{array} \right. \]

for(i = 0; i < m; ++i)
{
y[i] = beta * y[i];
for(j = csrRowPtr[i]; j < csrRowPtr[i + 1]; ++j)
{
y[i] = y[i] + alpha * csrVal[j] * x[csrColInd[j]];
}
}
Note
This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
Currently, only transA == HIPSPARSE_OPERATION_NON_TRANSPOSE is supported.
Deprecated:
This function is deprecated when using the CUDA backend (CUDA 10.0+) and will be removed in CUDA 11.0. This deprecation does not apply to the ROCm backend.
Parameters
[in]handle- handle to the hipSPARSE library context queue.
[in]transA- matrix operation type.
[in]m- number of rows of the sparse CSR matrix. Must be non-negative.
[in]n- number of columns of the sparse CSR matrix. Must be non-negative.
[in]nnz- number of non-zero entries of the sparse CSR matrix. Must be non-negative.
[in]alpha- scalar \(\alpha\).
[in]descrA- descriptor of the sparse CSR matrix. Currently, only HIPSPARSE_MATRIX_TYPE_GENERAL is supported.
[in]csrSortedValA- array of nnz elements of the sparse CSR matrix.
[in]csrSortedRowPtrA- array of m+1 elements that point to the start of every row of the sparse CSR matrix.
[in]csrSortedColIndA- array of nnz elements containing the column indices of the sparse CSR matrix.
[in]x- array of n elements ( \(op(A) == A\)) or m elements ( \(op(A) == A^T\) or \(op(A) == A^H\)).
[in]beta- scalar \(\beta\).
[in,out]y- array of m elements ( \(op(A) == A\)) or n elements ( \(op(A) == A^T\) or \(op(A) == A^H\)).
Return values
HIPSPARSE_STATUS_SUCCESSthe operation completed successfully.
HIPSPARSE_STATUS_NOT_INITIALIZEDhandle is not initialized.
HIPSPARSE_STATUS_INVALID_VALUEhandle, descrA, alpha, or beta is nullptr, m, n, or nnz is negative, or csrSortedValA, csrSortedRowPtrA, csrSortedColIndA, x, or y is nullptr.
HIPSPARSE_STATUS_ARCH_MISMATCHthe device is not supported.
HIPSPARSE_STATUS_NOT_SUPPORTEDhipsparseMatrixType_t is not HIPSPARSE_MATRIX_TYPE_GENERAL.

Member Function/Subroutine Documentation

◆ hipsparsescsrmv_()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsrmv::hipsparsescsrmv_ ( type(c_ptr), value  handle,
integer(kind(hipsparse_operation_non_transpose)), value  transa,
integer(c_int), value  m,
integer(c_int), value  n,
integer(c_int), value  nnz,
real(c_float)  alpha,
type(c_ptr), value  descra,
type(c_ptr), value  csrsortedvala,
type(c_ptr), value  csrsortedrowptra,
type(c_ptr), value  csrsortedcolinda,
type(c_ptr), value  x,
real(c_float)  beta,
type(c_ptr), value  y 
)

◆ hipsparsescsrmv_rank_0()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsrmv::hipsparsescsrmv_rank_0 ( type(c_ptr)  handle,
integer(kind(hipsparse_operation_non_transpose))  transa,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  nnz,
real(c_float)  alpha,
type(c_ptr)  descra,
real(c_float), target  csrsortedvala,
integer(c_int), target  csrsortedrowptra,
integer(c_int), target  csrsortedcolinda,
real(c_float), target  x,
real(c_float)  beta,
real(c_float), target  y 
)

◆ hipsparsescsrmv_rank_1()

integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsescsrmv::hipsparsescsrmv_rank_1 ( type(c_ptr)  handle,
integer(kind(hipsparse_operation_non_transpose))  transa,
integer(c_int)  m,
integer(c_int)  n,
integer(c_int)  nnz,
real(c_float)  alpha,
type(c_ptr)  descra,
real(c_float), dimension(:), target  csrsortedvala,
integer(c_int), dimension(:), target  csrsortedrowptra,
integer(c_int), dimension(:), target  csrsortedcolinda,
real(c_float), dimension(:), target  x,
real(c_float)  beta,
real(c_float), dimension(:), target  y 
)

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