Developer Reference

Contents

Graph API Glossary

The graph API in
Intel®
Math Kernel Library
provides error statuses and various options for graph operations in the form of predefined enumerators. All of them are described below with the lists of all possible options.

mkl_graph_type_t

The following table provides the possible types for data and indices supported by the graph routines.
Type
Description
MKL_GRAPH_TYPE_INT32
32-bit integer type
MKL_GRAPH_TYPE_INT64
64-bit integer type
MKL_GRAPH_TYPE_FP32
32-bit floating point type (float, data only)
MKL_GRAPH_TYPE_FP64
64-bit floating point type (double, data only)
MKL_GRAPH_TYPE_BOOL
Boolean type (data only)

mkl_graph_status_t

The return value type for all graph routines can be one of the return values listed in the following table.
Return Value Type
Description
MKL_GRAPH_STATUS_SUCCESS
The routine has been called successfully
MKL_GRAPH_STATUS_SUCCESS_NOT_INITIALIZED
One of the graph objects passed to the routine has not been initialized (corresponding
mkl_graph_<object>_create
routine has not been called).
MKL_GRAPH_STATUS_ALLOC_FAILED
Memory allocation has failed
MKL_GRAPH_STATUS_INVALID_VALUE
One of the input arguments has invalid value (for example, non-optional argument for a graph object has been passed as NULL)
MKL_GRAPH_STATUS_INTERNAL_ERROR
Internal (unclassified) error has been encountered during the execution
MKL_GRAPH_STATUS_NOT_SUPPORTED
A combination of provided parameters is currently not supported by the routine

mkl_graph_semiring_t

Defines which semiring will be used in a graph routine. All names for the semirings are of the form
MKL_GRAPH_SEMIRING_<ADDOP>_<MULTOP>_<DATATYPE>
where
ADDOP
and
MULTOP
define the additive and multiplicative operations of the semiring, respectively, and
DATATYPE
defines the type of the output. As an example, a standard semiring with single-precision floating point data is called
MKL_GRAPH_PLUS_TIMES_FP32
. All currently supported semirings are:
  • MKL_GRAPH_SEMIRING_PLUS_TIMES_INT32
  • MKL_GRAPH_SEMIRING_PLUS_TIMES_INT64
  • MKL_GRAPH_SEMIRING_PLUS_TIMES_FP32
  • MKL_GRAPH_SEMIRING_PLUS_TIMES_FP64

mkl_graph_accumulator_t

Defines which binary operator is used for the accumulation of the output values in a graph operation. If no accumulation is required, use
MKL_GRAPH_ACCUMULATOR_NONE
. All currently available options are:
  • MKL_GRAPH_ACCUMULATOR_NONE
  • MKL_GRAPH_ACCUMULATOR_PLUS
  • MKL_GRAPH_ACCUMULATOR_LOR
For example,
MKL_GRAPH_ACCUMULATOR_PLUS
for
mkl_graph_mxv
without a mask will add the matrix-vector product to the output vector instead of simply overwriting the output vector with the result.

mkl_graph_request_t

This parameter is used in several graph routines to allow multi-stage execution. For a simple single-stage execution, use
MKL_GRAPH_REQUEST_COMPUTE_ALL
. Multistage execution can be used, for example, when you need to compute only the structure of the output (say, for non-zero entries in a matrix) first and only then values. A reasonable use case for this is when you want to allocate memory for the output matrix externally. The following table provides the possible values for this parameter.
Value
Description
MKL_GRAPH_REQUEST_COMPUTE_ALL
Single-stage execution. All output data are computed during a single call to the routine.
MKL_GRAPH_REQUEST_COMPUTE_NNZ
Compute only the number of non-zero entries in the output object (matrix or vector)
MKL_GRAPH_REQUEST_COMPUTE_STRUCTURE
Compute only the structure (location) of non-zero entries in the output object (matrix or vector)
MKL_GRAPH_REQUEST_COMPUTE_VALUES
Compute only the values for the output data (matrix or vector). This request can be used only after a prior call with
MKL_GRAPH_REQUEST_COMPUTE_STRUCTURE

mkl_graph_method_t

A method (algorithm) which can be specified for a particular graph operation. The possible values are listed in the following table.
Value
Description
MKL_GRAPH_METHOD_AUTO
Automatic choice of the method
MKL_GRAPH_METHOD_DOT
Dot product method
MKL_GRAPH_METHOD_GUSTAVSON
Gustavson-like method

mkl_graph_descriptor_field_t

The enumerator
mkl_graph_descriptor_field_t
is used together with
mkl_graph_descriptor_field_value_t
to set the value for a descriptor field by calling
mkl_graph_descriptor_set_field
. When the descriptor is passed to a graph operation, these (field, value) pairs specify how graph objects in the argument list are handled in the operation. For example, the descriptor allows you to use the transpose of the first matrix and structural complement of the mask in
mkl_graph_mxm
without explicitly constructing those objects. The following table provides the possible values.
Value
Description
MKL_GRAPH_MODIFIER_OUTPUT
The output object will have a modifier
MKL_GRAPH_MODIFIER_FIRST_INPUT
The first input of a graph operation will have a modifier
MKL_GRAPH_MODIFIER_SECOND_INPUT
The second input of a graph operation will have a modifier
MKL_GRAPH_MODIFER_MASK
The mask will have a modifier in a graph operation

mkl_graph_descriptor_field_value_t

The enumerator
mkl_graph_descriptor_field_value_t
is used together with
mkl_graph_descriptor_field_t
to set the value for a descriptor field by calling
mkl_graph_descriptor_set_field
. When the descriptor is passed to a graph operation, these (field, value) pairs specify how graph objects in the argument list are handled in the operation. For example, the descriptor allows you to use the transpose of the first matrix and structural complement of the mask in
mkl_graph_mxm
without explicitly constructing those objects. The possible values are listed in the following table.
Value
Description
MKL_GRAPH_NO_MODIFIER
No modifier
MKL_GRAPH_STRUCTURE_COMPLEMENT
Use the structural complement instead of the structure at hand
MKL_GRAPH_TRANSPOSE
Use the transpose of a matrix or a vector
MKL_GRAPH_REPLACE
Replace the matrix with the output
MKL_GRAPH_ONLY_STRUCTURE
Do not use the values (equivalent to considering all values equal to 1)
MKL_GRAPH_KEEP_MASK_STRUCTURE
Keep the non-zero pattern of the mask entirely in the output. All elements which are not present in the result before applying the mask will be marked as zeros.
This option allows more aggressive optimizations but adds edges with zero weight to the output graph.

mkl_graph_property_t

Properties of graph matrices and vectors which can be queried using API routines
mkl_graph_<object>_get_property
. The possible values are listed in the following table.
Property Name
Description
MKL_GRAPH_PROPERTY_NROWS
Type:
int64_t
. Number of rows in a graph matrix or vector
MKL_GRAPH_PROPERTY_NCOLS
Type:
int64_t
. Number of columns in a graph matrix or vector
MKL_GRAPH_PROPERTY_NNZ
Type:
int64_t
. Number of non-zero entries in a graph matrix or vector

Product and Performance Information

1

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