rocsparse_sdoti Interface Reference

rocsparse_sdoti Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::rocsparse_sdoti Interface Reference
hipfort_rocsparse::rocsparse_sdoti Interface Reference

Compute the dot product of a sparse vector with a dense vector. More...

Public Member Functions

integer(kind(rocsparse_status_success)) function rocsparse_sdoti_ (handle, nnz, x_val, x_ind, y, myresult, idx_base)
 
integer(kind(rocsparse_status_success)) function rocsparse_sdoti_rank_0 (handle, nnz, x_val, x_ind, y, myresult, idx_base)
 
integer(kind(rocsparse_status_success)) function rocsparse_sdoti_rank_1 (handle, nnz, x_val, x_ind, y, myresult, idx_base)
 

Detailed Description

Compute the dot product of a sparse vector with a dense vector.

rocsparse_doti computes the dot product of the sparse vector \(x\) with the dense vector \(y\), such that

\[ \text{result} := y^T x \]

result = 0
for(i = 0; i < nnz; ++i)
{
result += x_val[i] * y[x_ind[i]];
}
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 vector \(x\).
[in]x_val- array of nnz values.
[in]x_ind- array of nnz elements containing the indices of the non-zero values of \(x\).
[in]y- array of values in dense format.
[out]myResult- pointer to the result, which can be in host or device memory.
[in]idx_base- rocsparse_index_base_zero or rocsparse_index_base_one.
Return values
rocsparse_status_successthe operation completed successfully.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_invalid_valueidx_base is invalid.
rocsparse_status_invalid_sizennz is invalid.
rocsparse_status_invalid_pointerx_val, x_ind, y, or result pointer is invalid.
rocsparse_status_memory_errorthe buffer for the dot product reduction could not be allocated.
rocsparse_status_internal_erroran internal error occurred.
Example

Member Function/Subroutine Documentation

◆ rocsparse_sdoti_()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sdoti::rocsparse_sdoti_ ( 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,
type(c_ptr), value  myresult,
integer(kind(rocsparse_index_base_zero)), value  idx_base 
)

◆ rocsparse_sdoti_rank_0()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sdoti::rocsparse_sdoti_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), target  myresult,
integer(kind(rocsparse_index_base_zero))  idx_base 
)

◆ rocsparse_sdoti_rank_1()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sdoti::rocsparse_sdoti_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), dimension(:), target  myresult,
integer(kind(rocsparse_index_base_zero))  idx_base 
)

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