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 nnzvalues.[in] x_ind - array of nnzelements 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_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 x_val,x_ind,y, orresultpointer is invalid.rocsparse_status_memory_error the buffer for the dot product reduction could not be allocated. rocsparse_status_internal_error an 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: