Visible to Intel only — GUID: GUID-5A979A9F-37E3-40E0-86B6-B80E11FD607F
Visible to Intel only — GUID: GUID-5A979A9F-37E3-40E0-86B6-B80E11FD607F
oneapi::mkl::sparse::init_matrix_handle
Allocates memory on the heap for a oneapi::mkl::sparse::matrix_handle_t object, initializes the internals of that object to default values, and returns with the address to that object.
Description
The oneapi::mkl::sparse::init_matrix_handle function initializes the oneapi::mkl::sparse::matrix_handle_t object with default values, otherwise it throws an exception.
The following is a recommended usage model:
using namespace oneapi::mkl;
// set newly created handle to nullptr before sending to
// init_matrix_handle for initialization
sparse::matrix_handle_t spMat = nullptr;
sparse::init_matrix_handle(&spMat);
// handle is now initialized and can be filled and used
sycl::event ev_set = sparse::set_csr_data(queue, spMat, /*matrix sizes and arrays */);
// when finished, clean up the handle
sycl::event ev_release = sparse::release_matrix_handle(queue, &spMat, dependencies);
ev_release.wait(); // make it blocking
API
Syntax
namespace oneapi::mkl::sparse {
void init_matrix_handle (
oneapi::mkl::sparse::matrix_handle_t *p_spMat)
}
Include Files
oneapi/mkl/spblas.hpp
Input Parameters
- p_spMat
-
The address of the sparse::matrix_handle_t handle to be initialized. We recommend that the sparse::matrix_handle_t handle object be set to nullptr before entry to this function to avoid confusion if it is previously initialized or not. This function allocates and initializes a matrix_handle_t object and sets the p_spMat to this new object. This initialization routine must only be called on an uninitialized matrix_handle object.
Output Parameters
- p_spMat
-
On return, the address is updated to point to a newly allocated and initialized matrix_handle_t object that can be filled and used to perform sparse BLAS operations.