oneapi::mkl::sparse::sort_matrix

Performs in-place sorting of user-provided matrix arrays in a matrix handle.

Description

Note

Refer to Error Handling for a detailed description of the possible exceptions thrown.

The oneapi::mkl::sparse::sort_matrix API performs in-place sorting of user-provided sparse matrix arrays stored in a given sparse matrix handle.

Note

This routine modifies user-arrays provided to oneMKL through the matrix handle creation routines, oneapi::mkl::sparse::set_<sparse_matrix_type>_data.

API

Syntax

Note

Currently, complex types are not supported.

Using USM and SYCL buffers:

namespace oneapi::mkl::sparse {
    sycl::event sort_matrix (
        sycl::queue &queue,
        oneapi::mkl::sparse::matrix_handle_t handle,
        const std::vector<sycl::event> &dependencies = {});
}

Include Files

  • oneapi/mkl/spblas.hpp

Input Parameters

queue

Specifies the SYCL command queue which will be used for SYCL kernels execution.

handle

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

Currently, the only supported matrix format for <sparse_matrix_type> is the csr format.

dependencies

A vector of type std::vector<sycl::event> & containing the list of events that the oneapi::mkl::sparse::sort_matrix routine depends on.

Return Values

sycl::event

SYCL event which can be waited upon or added as a dependency for the completion of the sort_matrix routine.

// Examples of API arguments and usage
sycl::event ev_opt = sparse::sort_matrix(queue, handle);               // Allowed use in case of USM
sycl::event ev_opt = sparse::sort_matrix(queue, handle, {});           // Allowed use in case of USM
sycl::event ev_opt = sparse::sort_matrix(queue, handle, dependencies); // Allowed use in case of USM
sparse::sort_matrix(queue, handle);                                    // Recommended use in case of sycl::buffer
sparse::sort_matrix(queue, handle, {});                                // Not recommended in case of sycl::buffer, but supported;
sparse::sort_matrix(queue, handle, dependencies);                      // Not recommended in case of sycl::buffer, but supported;
sycl::event ev_opt = sparse::sort_matrix(queue, handle);               // Not recommended in case of sycl::buffer, but supported. Note that most sycl::buffer oneMKL APIs do not have ability to pass in dependencies