set_matrix_property

set_matrix_property#

Matrix properties#

namespace oneapi::mkl::sparse {

    enum class matrix_property {
       symmetric,
       sorted,
    };

}

Matrix properties are optional and “strong” guarantees. Unlike matrix_view, the user must ensure that the handle’s data holds all the given properties. A property can be set as a hint for backends to optimize some operations. Multiple properties can be set to the same handle.

Value

Description

symmetric

Guarantees that the user-provided matrix data are symmetric, meaning the matrix is square, the user data contain both lower and upper triangular regions, and that its transpose is equal to itself.

sorted

Guarantees that the user-provided matrix data has some sorting property.
For CSR this guarantees that the column indices are sorted in ascending order for a given row.
For COO this guarantees that the indices are sorted by row then by column in ascending order.

set_matrix_property#

Set a property to a matrix_handle_t object.

Description and Assumptions

The oneapi::mkl::sparse::set_matrix_property function sets a property to a matrix handle.

Syntax

namespace oneapi::mkl::sparse {

    bool set_matrix_property (sycl::queue                          &queue,
                              oneapi::mkl::sparse::matrix_handle_t smhandle,
                              matrix_property                      property);

}

Input parameters

queue

The SYCL command queue which will be used for SYCL kernels execution.

smhandle

Initialized sparse matrix handle.

property

Matrix property to set.

Return Values

Return whether the property was set to the backend’s handle. A backend may not have an equivalent property.

Throws

This function 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: Data handles