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

rocsparse_sddmm Interface Reference

rocsparse_sddmm Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::rocsparse_sddmm Interface Reference
hipfort_rocsparse::rocsparse_sddmm Interface Reference

Sampled Dense-Dense Matrix Multiplication. More...

Public Member Functions

integer(kind(rocsparse_status_success)) function rocsparse_sddmm_ (handle, opA, opB, alpha, A, B, beta, C, compute_type, alg, temp_buffer)
 

Detailed Description

Sampled Dense-Dense Matrix Multiplication.

rocsparse_sddmm multiplies the scalar \(\alpha\) with the dense \(m \times k\) matrix \(A\), the dense \(k \times n\) matrix \(B\), filtered by the sparsity pattern of the \(m \times n\) sparse matrix \(C\) and adds the result to \(C\) scaled by \(\beta\). The final result is stored in the sparse \(m \times n\) matrix \(C\), such that

\[ C := \alpha ( opA(A) \cdot opB(B) ) \cdot spy(C) + \beta C, \]

with

\[ op(A) = \left\{ \begin{array}{ll} A, & \text{if opA == rocsparse_operation_none} \newline A^T, & \text{if opA == rocsparse_operation_transpose} \newline \end{array} \right. \]

,

\[ op(B) = \left\{ \begin{array}{ll} B, & \text{if opB == rocsparse_operation_none} \newline B^T, & \text{if opB == rocsparse_operation_transpose} \newline \end{array} \right. \]

and

\[ spy(C)_ij = \left\{ \begin{array}{ll} 1 \text{if i == j}, & 0 \text{if i != j} \newline \end{array} \right. \]

Note
opA == rocsparse_operation_conjugate_transpose is not supported.
opB == rocsparse_operation_conjugate_transpose is not supported.
Parameters
[in]handlehandle to the rocsparse library context queue.
[in]opAdense matrix \(A\) operation type.
[in]opBdense matrix \(B\) operation type.
[in]alphascalar \(\alpha\).
[in]Adense matrix \(A\) descriptor.
[in]Bdense matrix \(B\) descriptor.
[in]betascalar \(\beta\).
[in,out]Csparse matrix \(C\) descriptor.
[in]compute_typefloating point precision for the SDDMM computation.
[in]algspecification of the algorithm to use.
[in]temp_buffertemporary storage buffer allocated by the user. The size must be greater or equal to the size obtained with rocsparse_sddmm_buffer_size.
Return values
rocsparse_status_successthe operation completed successfully.
rocsparse_status_invalid_valuethe value of trans_A, trans_B, compute_type or alg is incorrect.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_invalid_pointeralpha and beta are invalid, A, B, D, C or temp_buffer pointer is invalid.
rocsparse_status_not_implementedopA == rocsparse_operation_conjugate_transpose or opB == rocsparse_operation_conjugate_transpose.

Member Function/Subroutine Documentation

◆ rocsparse_sddmm_()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sddmm::rocsparse_sddmm_ ( type(c_ptr), value  handle,
integer(kind(rocsparse_operation_none)), value  opA,
integer(kind(rocsparse_operation_none)), value  opB,
type(c_ptr), value  alpha,
type(c_ptr), value  A,
type(c_ptr), value  B,
type(c_ptr), value  beta,
type(c_ptr), value  C,
integer(kind(rocsparse_datatype_f32_r)), value  compute_type,
integer(kind(rocsparse_sddmm_alg_default)), value  alg,
type(c_ptr), value  temp_buffer 
)

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