onemkl::sparse::setCSRstructure¶
Creates a handle for a CSR matrix.
Syntax
Using SYCL buffers:
-
void
onemkl::sparse
::
setCSRstructure
(matrixHandle_t handle, intType nRows, intType nCols, onemkl::index_base index, cl::sycl::buffer<intType, 1> &rowIndex, cl::sycl::buffer<intType, 1> &colIndex, cl::sycl::buffer<fp, 1> &values)¶
Using USM pointers:
-
void
onemkl::sparse
::
setCSRstructure
(matrixHandle_t handle, intType nRows, intType nCols, onemkl::index_base index, intType *rowIndex, intType *colIndex, fp *values)¶
Include Files
mkl_spblas_sycl.hpp
Description
The onemkl::sparse::setCSRstructure routine creates a handle for a
sparse matrix of dimensions nRows
-by-nCols
represented in
the CSR format..
Note
Refer to Supported
Types for a
list of supported <fp>
and <intType>
, and refer to
Exceptions
for a detailed description of the exceptions thrown.
Input Parameters
- handle
Handle to object containing sparse matrix and other internal data for subsequent SYCL Sparse BLAS operations.
- nRows
Number of rows of the input matrix .
- nCols
Number of columns of the input matrix .
- Index
Indicates how input arrays are indexed.
onemkl::index_base::zero
Zero-based (C-style) indexing: indices start at 0.
onemkl::index_base::one
One-based (Fortran-style) indexing: indices start at 1.
- rowIndex
SYCL or USM memory object containing an array of length
m+1
. This array contains row indices, such thatrowsIndex[i]
-indexing
is the first index of rowi
in the arraysvalues
andcolIndex. indexing
takes 0 for zero-based indexing and 1 for one-based indexing. Refer topointerB
andpointerE
array description in Sparse BLAS CSR Matrix Storage Format for more details.Note
Refer to Three Array Variation of CSR Format for more details.
- colIndex
SYCL or USM memory object which stores an array containing the column indices in
index
-based numbering (index
takes 0 for zero-based indexing and 1 for one-based indexing) for each non-zero element of the input matrix. Its length is at leastnrows
.- values
SYCL or USM memory object which stores an array containing non-zero elements of the input matrix. Its length is equal to length of the
colIndex
array. Refer to the values array description in Sparse BLAS CSR Matrix Storage Format for more details.
Output Parameters
- handle
Handle to object containing sparse matrix and other internal data for subsequent Sycl Sparse BLAS operations.
Parent topic: Sparse BLAS Routines