Intel® oneAPI Math Kernel Library Developer Reference - C

mkl_graph_matrix_get_csr

Exports a CSR representation of a graph matrix.

Syntax

mkl_graph_status_t mkl_graph_matrix_get_csr (mkl_graph_matrix_t A, int64_t *nrows, int64_t *ncols, void **rows_start, mkl_graph_type_t *rows_start_type, void **col_indx, mkl_graph_type_t *col_indx_type, void **values, mkl_graph_type_t *values_type);

Include Files

Description

The mkl_graph_matrix_get_csr routine exports the CSR representation of a graph matrix in the 3-array variation. All output arguments are optional and will not be used if NULL pointers are passed. For each array in the 3-array CSR format (rows_start, col_indx or values) the type of the elements can be obtained from a corresponding parameter of type mkl_graph_type_t.

Refer to Sparse Matrix Storage Formats for further details on the CSR format.

Note

The routine mkl_graph_matrix_get_csr does not change the ownership of the data. In particular, you should not directly deallocate the returned pointers. A call to mkl_graph_matrix_destroy handles freeing any data allocated by Intel® oneAPI Math Kernel Library.

Note

If only information about the number of rows or the number of columns is needed, mkl_graph_matrix_get_property can be used instead of mkl_graph_matrix_get_csr.

Input Parameters

A

A graph matrix from which data are retrieved.

Output Parameters

nrows

Number of rows in the matrix. Ignored if NULL is passed.

ncols

Number of columns in the matrix. Ignored if NULL is passed.

rows_start

A pointer to an array of length at least (n+1), where n is the number of rows in the matrix. The array contains row indices, such that rows_start[i] is the index of the first non-zero entry in row i in the arrays col_indx and values. The value rows_start[n]- rows_start[0] will be the total number of nonzero entries in the matrix. Type of the array elements can be deduced from rows_start_type.

Ignored if NULL.

Refer to pointerB array description in CSR Format for more details.

rows_start_type

Type of the elements of the rows_start array. Refer to Graph API Glossary for a list of possible options. Ignored if NULL is passed.

col_indx

A pointer to an array which contains zero-based column indices for the non-zero entries of the matrix A. Type of the array elements can be deduced from col_indx_type. Ignored if NULL.

Refer to the columns array description in CSR Format for more details.

col_indx_type

Type of the elements of the col_indx array. Refer to Graph API Glossary for a list of possible options. Ignored if NULL is passed.

values

A pointer to an array which contains values for the nonzero entries of the matrix A. The type of the array elements can be deduced from values_type.

Ignored if NULL.

Refer to the values array description in CSR Format for more details.

values_type

Type of the elements of the values array. Refer to Graph API Glossary for a list of possible options. Ignored if NULL is passed.

Return Values

The function returns a value indicating whether the operation was successful or not and why. Refer to Graph API Glossary for a list of possible options.

Optimization Notice

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804

This notice covers the following instruction sets: SSE2, SSE4.2, AVX2, AVX-512.