rocsparse_spvv Interface Reference#
hipfort_rocsparse::rocsparse_spvv Interface Reference
Sparse vector inner dot product. More...
Public Member Functions | |
integer(kind(rocsparse_status_success)) function | rocsparse_spvv_ (handle, trans, x, y, myResult, compute_type, buffer_size, temp_buffer) |
Detailed Description
Sparse vector inner dot product.
rocsparse_spvv
computes the inner dot product of the sparse vecotr \(x\) with the dense vector \(y\), such that
\[ \text{result} := x^{'} \cdot y, \]
with
\[ op(x) = \left\{ \begin{array}{ll} x, & \text{if trans == rocsparse_operation_none} \newline \bar{x}, & \text{if trans == rocsparse_operation_conjugate_transpose} \newline \end{array} \right. \]
result = 0;
for(i = 0; i < nnz; ++i)
{
result += x_val[i] * y[x_ind[i]];
}
- Note
- This function writes the required allocation size (in bytes) to
buffer_size
and returns without performing the SpVV operation, when a nullptr is passed fortemp_buffer
. - This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
- Parameters
-
[in] handle handle to the rocsparse library context queue. [in] trans sparse vector operation type. [in] x sparse vector descriptor. [in] y dense vector descriptor. [out] result pointer to the result, can be host or device memory [in] compute_type floating point precision for the SpVV computation. [out] buffer_size number of bytes of the temporary storage buffer. buffer_size is set when temp_buffer
is nullptr.[in] temp_buffer temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written to buffer_size
and function returns without performing the SpVV operation.
- Return values
-
rocsparse_status_success the operation completed successfully. rocsparse_status_invalid_handle the library context was not initialized. rocsparse_status_invalid_pointer x
,y
,result
orbuffer_size
pointer is invalid.rocsparse_status_not_implemented compute_type
is currently not supported.
Member Function/Subroutine Documentation
◆ rocsparse_spvv_()
integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_spvv::rocsparse_spvv_ | ( | type(c_ptr), value | handle, |
integer(kind(rocsparse_operation_none)), value | trans, | ||
type(c_ptr), value | x, | ||
type(c_ptr), value | y, | ||
type(c_ptr), value | myResult, | ||
integer(kind(rocsparse_datatype_f32_r)), value | compute_type, | ||
integer(c_size_t) | buffer_size, | ||
type(c_ptr), value | temp_buffer | ||
) |
The documentation for this interface was generated from the following file: