Data Types#

BLAS and LAPACK Data Types#

Intel® oneAPI Math Kernel Library (oneMKL) BLAS and LAPACK for Data Parallel C++ (DPC++) introduces several new enumeration data types, which are type-safe versions of the traditional Fortran characters in BLAS and LAPACK. They are declared in oneapi/mkl/types.hpp, which is included automatically when you include oneapi/mkl/blas.hpp or oneapi/mkl/lapack.hpp. Like all oneMKL DPC++ functionality, they belong to the namespace oneapi::mkl::.

Each enumeration value comes with two names: A single-character name (the traditional BLAS/LAPACK character) and a longer, descriptive name. The two names are exactly equivalent and may be used interchangeably.

Transpose#

The transpose type specifies whether an input matrix should be transposed and/or conjugated. It can take the following values:

Short Name

Long Name

Description

transpose::N

transpose::nontrans

Do not transpose or conjugate the matrix.

transpose::T

transpose::trans

Transpose the matrix.

transpose::C

transpose::conjtrans

Perform Hermitian transpose (transpose and conjugate). Only applicable to complex matrices.

Uplo#

The uplo type specifies whether the lower or upper triangle of a triangular, symmetric, or Hermitian matrix should be accessed. It can take the following values:

Short Name

Long Name

Description

uplo::U

uplo::upper

Access the upper triangle of the matrix.

uplo::L

uplo::lower

Access the lower triangle of the matrix.

In both cases, elements that are not in the selected triangle are not accessed or updated.

Diag#

The diag type specifies the values on the diagonal of a triangular matrix. It can take the following values:

Short Name

Long Name

Description

diag::N

diag::nonunit

The matrix is not unit triangular. The diagonal entries are stored with the matrix data.

diag::U

diag::unit

The matrix is unit triangular (the diagonal entries are all 1s). The diagonal entries in the matrix data are not accessed.

Side#

The side type specifies the order of matrix multiplication when one matrix has a special form (triangular, symmetric, or Hermitian):

Short Name

Long Name

Description

side::L

side::left

The special form matrix is on the left in the multiplication.

side::R

side::right

The special form matrix is on the right in the multiplication.

Offset#

The offset type specifies whether the offset to apply to an output matrix is a fix offset, column offset or row offset. It can take the following values

Short Name

Long Name

Description

offset::F

offset::fix

The offset to apply to the output matrix is fix, all the inputs in the C_offset matrix has the same value given by the first element in the co array.

offset::C

offset::column

The offset to apply to the output matrix is a column offset, that is to say all the columns in the C_offset matrix are the same and given by the elements in the co array.

offset::R

offset::row

The offset to apply to the output matrix is a row offset, that is to say all the rows in the C_offset matrix are the same and given by the elements in the co array.

value_or_pointer#

The value_or_pointer type is used as a wrapper to enable users to pass either a pointer or a value to BLAS routines that take scalar parameters (usually named alpha or beta). Its use is described in Scalar Arguments.

Vector Math Data Types#

oneMKL VM for Data Parallel C++ (DPC++) introduces a slice type, available in the oneapi::mkl namespace. Slices are used in the DPC++ VM Strided APIs. oneMKL slices accept positive, zero, and negative strides, for forward, static, and backward traversals of a vector, respectively.

Constructors

Description

slice()

Default constructor equivalent to slice(0, 0, 0).

slice(std::size_t start, std::size_t size, std::int64_t stride)

Slice defining the start index, the number of values to select, and the stride between two elements.

slice(const slice & other)

Copy constructor.

For example:

  • slice(1, 5, 2) defines a selector of elements at indices 1, 3, 5, 7, 9 in a buffer or array;

  • slice(0, 5, 0) defines a selector of a single element at index 0, repeated five times;

  • slice(9, 4, -3) defines a selector of elements at indices 9, 6, 3, 0.

A slice is considered invalid if it produces negative indices. A slice of size 0 selects no element. If a slice may cause out-of-bounds memory accesses, the behavior is undefined.

The behavior of VM Strided APIs used with invalid or non-equal slices is configurable with several oneMKL VM mode values. See the set_mode function for possible values and their descriptions.

In the slice_cyclic mode, zero-sized slices are invalid.