set_csr_data#
Takes a matrix handle and the input CSR matrix arrays and fills the internal CSR data structure.
Description and Assumptions
Refer to Supported Types for a
list of supported <fp>
and <intType>
.
The mkl::sparse::set_csr_data routine takes a matrix handle
for a sparse matrix of dimensions num_rows -by- num_cols
represented in the CSR format, and fills the internal
CSR data structure.
set_csr_data (Buffer version)#
Syntax
namespace oneapi::mkl::sparse {
void set_csr_data (sycl::queue &queue,
oneapi::mkl::sparse::matrix_handle_t handle,
intType num_rows,
intType num_cols,
oneapi::mkl::index_base index,
sycl::buffer<intType, 1> &row_ptr,
sycl::buffer<intType, 1> &col_ind,
sycl::buffer<fp, 1> &val);
}
Input Parameters
- queue
The SYCL command queue which will be used for SYCL kernel execution.
- handle
Handle to object containing sparse matrix and other internal data for subsequent DPC++ Sparse BLAS operations.
- num_rows
Number of rows of the input matrix .
- num_cols
Number of columns of the input matrix .
- index
Indicates how input arrays are indexed. The possible options are described in index_base enum class.
- row_ptr
SYCL memory object containing an array of length
num_rows+1
. Refer to CSR format for detailed description ofrow_ptr
.- col_ind
SYCL memory object which stores an array containing the column indices in
index
-based numbering. Refer to CSR format for detailed description ofcol_ind
.- val
SYCL memory object which stores an array containing non-zero elements of the input matrix. Refer to CSR format for detailed description of
val
.
Output Parameters
- handle
Handle to object containing sparse matrix and other internal data for subsequent SYCL Sparse BLAS operations.
Throws
This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.
set_csr_data (USM version)#
Syntax
namespace oneapi::mkl::sparse {
sycl::event set_csr_data (sycl::queue &queue,
oneapi::mkl::sparse::matrix_handle_t handle,
intType num_rows,
intType num_cols,
oneapi::mkl::index_base index,
intType *row_ptr,
intType *col_ind,
fp *val,
const std::vector<sycl::event> &dependencies = {});
}
Input Parameters
- queue
The SYCL command queue which will be used for SYCL kernel execution.
- handle
Handle to object containing sparse matrix and other internal data for subsequent DPC++ Sparse BLAS operations.
- num_rows
Number of rows of the input matrix .
- num_cols
Number of columns of the input matrix .
- index
Indicates how input arrays are indexed. The possible options are described in index_base enum class.
- row_ptr
USM object containing an array of length
num_rows+1
. Refer to CSR format for detailed description ofrow_ptr
- col_ind
USM object which stores an array containing the column indices in
index
-based numbering. Refer to CSR format for detailed description ofcol_ind
- val
USM object which stores an array containing non-zero elements of the input matrix. Refer to CSR format for detailed description of
val
- dependencies
A vector of type const std::vector<sycl::event> & containing the list of events that the oneapi::mkl::sparse::set_csr_data routine depends on.
Output Parameters
- handle
Handle to object containing sparse matrix and other internal data for subsequent SYCL Sparse BLAS operations.
Return Values
- sycl::event
A sycl::event that can be used to track the completion of asynchronous events that were enqueued during the API call that continue the chain of events from the input dependencies.
Throws
This routine shall throw the following exceptions if the associated condition is detected. An implementation may throw additional implementation-specific exception(s) in case of error conditions not covered here.
Parent topic: Sparse BLAS