Visible to Intel only — GUID: GUID-C5F4A385-B075-4BAC-AAE7-D5F472ECFF37
Visible to Intel only — GUID: GUID-C5F4A385-B075-4BAC-AAE7-D5F472ECFF37
oneapi::mkl::sparse::matmatd
Computes a sparse matrix-sparse matrix product with a dense result.
Description
The oneapi::mkl::sparse::matmatd routine computes a sparse matrix-sparse matrix product with a dense matrix result defined as
where: and are scalars, and are sparse matrices, and is a dense matrix of size c_nrows rows by c_ncols columns, and is a matrix modifier for A and B using the following description:
The dense matrix object C is stored with row-major or column-major layout. The sparse matrix objects A and B have an appropriate number of rows and columns for the matrix product.
API
Syntax
Using SYCL buffers:
namespace oneapi::mkl::sparse {
void matmatd(sycl::queue &queue,
oneapi::mkl::layout c_layout,
oneapi::mkl::transpose opA,
oneapi::mkl::transpose opB,
const DATA_TYPE alpha,
matrix_handle_t A,
matrix_handle_t B,
const DATA_TYPE beta,
sycl::buffer<DATA_TYPE, 1> &C
const std::int64_t c_nrows,
const std::int64_t c_ncols,
const std::int64_t ldc);
}
Using USM pointers:
namespace oneapi::mkl::sparse {
sycl::event matmatd(
sycl::queue &queue,
oneapi::mkl::layout c_layout,
oneapi::mkl::transpose opA,
oneapi::mkl::transpose opB,
const DATA_TYPE alpha,
matrix_handle_t A,
matrix_handle_t B,
const DATA_TYPE beta,
DATA_TYPE *C,
const std::int64_t c_nrows,
const std::int64_t c_ncols,
const std::int64_t ldc,
const std::vector<sycl::event> &dependencies = {});
}
Include Files
oneapi/mkl/spblas.hpp
Input Parameters
- queue
-
Specifies the SYCL command queue that will be used for SYCL kernels execution.
- c_layout
-
Specifies the storage scheme in memory for the dense matrix C.
- opA
-
Specifies operation op() on input matrix A.
oneapi::mkl::transpose::nontrans
Non-transpose, .
oneapi::mkl::transpose::trans
Transpose, .
oneapi::mkl::transpose::conjtrans
Conjugate transpose, .
- opB
-
Specifies operation op() on input matrix B.
oneapi::mkl::transpose::nontrans
Non-transpose, .
oneapi::mkl::transpose::trans
Transpose, .
oneapi::mkl::transpose::conjtrans
Conjugate transpose, .
- alpha
-
Specifies the scalar, .
- A
-
Handle to object containing sparse matrix and other internal data. Created using one of the oneapi::mkl::sparse::set_<sparse_matrix_type>_data routines.
NOTE:The ony currently supported case for <sparse_matrix_type> is csr. - B
-
Handle to object containing sparse matrix and other internal data. Created using one of the oneapi::mkl::sparse::set_<sparse_matrix_type>_data routines.
NOTE:The ony currently supported case for <sparse_matrix_type> is csr. - beta
-
Specifies the scalar, .
- C
-
SYCL buffer or device-accessible USM pointer of size at least rows*cols, where
layout=oneapi::mkl::layout::col_major
layout=oneapi::mkl::layout::row_major
rows (number of rows in C)
ldc
c_ncols
cols (number of columns in C)
c_nrows
ldc
- c_nrows
-
Number of rows of matrix C.
- c_ncols
-
Number of columns of matrix C.
- ldc
-
Specifies the leading dimension of matrix C. Must be positive, and at least c_ncols if c_layout=oneapi::mkl::layout::row_major or at least c_nrows if c_layout=oneapi::mkl::layout::col_major.
- dependencies
-
A vector of type std::vector<sycl::event> containing the list of events that the oneapi::mkl::sparse::matmatd routine depends on.
Output Parameters
- C
-
Overwritten by the updated matrix C.
Return Values (USM Only)
- sycl::event
-
SYCL event that can be waited upon or added as a dependency for the completion of the matmatd routine.
Examples
An example of how to use oneapi::mkl::sparse::matmatd with SYCL buffers or USM can be found in the oneMKL installation directory, under:
share/doc/mkl/examples/sycl/sparse_blas/source/csr_matmatd.cpp
share/doc/mkl/examples/sycl/sparse_blas/source/csr_matmatd_usm.cpp