This page contains proposed changes for a future release of ROCm. Read the latest Linux release of ROCm documentation for your production environments.

rocsparse_spvv Interface Reference

rocsparse_spvv Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::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 for temp_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]handlehandle to the rocsparse library context queue.
[in]transsparse vector operation type.
[in]xsparse vector descriptor.
[in]ydense vector descriptor.
[out]resultpointer to the result, can be host or device memory
[in]compute_typefloating point precision for the SpVV computation.
[out]buffer_sizenumber of bytes of the temporary storage buffer. buffer_size is set when temp_buffer is nullptr.
[in]temp_buffertemporary 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_successthe operation completed successfully.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_invalid_pointerx, y, result or buffer_size pointer is invalid.
rocsparse_status_not_implementedcompute_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: