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 |
---|---|---|
|
|
Do not transpose or conjugate the matrix. |
|
|
Transpose the matrix. |
|
|
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 |
---|---|---|
|
|
Access the upper triangle of the matrix. |
|
|
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 |
---|---|---|
|
|
The matrix is not unit triangular. The diagonal entries are stored with the matrix data. |
|
|
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 |
---|---|---|
|
|
The special form matrix is on the left in the multiplication. |
|
|
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 |
---|---|---|
|
|
The offset to apply to the output matrix is fix, all the inputs in the |
|
|
The offset to apply to the output matrix is a column offset, that is to say all the columns in the |
|
|
The offset to apply to the output matrix is a row offset, that is to say all the rows in the |
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( |
Slice defining the start index, the number of values to select, and the stride between two elements. |
slice( |
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.