Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Graph Objects

The graph API in Intel® oneAPI Math Kernel Library makes use of the following graph objects, which are implemented as opaque structures (following the direction of the GraphBLAS C API Specification). The user is required to operate them only through the provided graph API (refer to the Graph API Glossary for other types specific to the graph API).

Graph objects must be created by calling mkl_graph_<object>_create prior to any operations with them, and destroyed by calling mkl_graph_<object>_destroy when they are no longer needed in order to avoid memory leaks.

Graph objects can take in user data through the APIs of mkl_graph_<object>_set_<format> or can have their data created as a result of calling a graph operation (for example, mkl_graph_mxm can create data for an output graph matrix). In the former case, the library assumes that any buffers passed as arguments to mkl_graph_<object>_set_<format> routines persist for the life of the graph object or until a set routine is called for an existing format, whichever is shorter. Calling a set routine for an existing format resets the data of the graph object to the new data. After destroying the graph object or resetting its data, you can safely deallocate data used as input to an mkl_graph_<object>_set_<format> routine. Intel® oneAPI Math Kernel Library will never deallocate user-allocated memory.

Graph Object Description

mkl_graph_matrix_t

A graph matrix (internal storage format can be changed throughout execution)

mkl_graph_vector_t

A graph vector (internal storage format can be changed throughout execution)

mkl_graph_descriptor_t

A descriptor for a graph operation. It is a lightweight object which enables the user to provide additional modifiers for the operands in a graph operation (for example, set a transposition flag for one of the matrices in mkl_graph_mxm, or use the complement of the mask’s structure).