Eigen  5.0.1
 
Loading...
Searching...
No Matches
BlasTypes.h
1/*
2 Copyright (c) 2011, Intel Corporation. All rights reserved.
3
4 Redistribution and use in source and binary forms, with or without modification,
5 are permitted provided that the following conditions are met:
6
7 * Redistributions of source code must retain the above copyright notice, this
8 list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright notice,
10 this list of conditions and the following disclaimer in the documentation
11 and/or other materials provided with the distribution.
12 * Neither the name of Intel Corporation nor the names of its contributors may
13 be used to endorse or promote products derived from this software without
14 specific prior written permission.
15
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27 ********************************************************************************
28 * Content : Eigen bindings to Intel(R) MKL
29 * Scalar and index types of the external BLAS/LAPACK interface, split out of MKL_support.h
30 ********************************************************************************
31*/
32// SPDX-License-Identifier: BSD-3-Clause
33
34#ifndef EIGEN_BLAS_TYPES_H
35#define EIGEN_BLAS_TYPES_H
36
37/* Scalar and index types of the external BLAS/LAPACK interface. These are used pervasively by the BLAS and LAPACKE
38 * backends, so they live in a backend-neutral header rather than in MKL_support.h. BlasIndex follows the integer
39 * width selected there (MKL_INT for MKL, EIGEN_BLAS_INT otherwise), so this header must be included after
40 * MKL_support.h has set those up; MKL_support.h includes it for that reason.
41 */
42
43// IWYU pragma: private
44#include "../InternalHeaderCheck.h"
45
46namespace Eigen {
47
48using dcomplex = std::complex<double>;
49using scomplex = std::complex<float>;
50
51#if defined(EIGEN_USE_MKL)
52using BlasIndex = MKL_INT;
53// Plain static_assert (not EIGEN_STATIC_ASSERT): like the LAPACKE/BLAS cross-check it must not be suppressible.
54#if defined(EIGEN_64BIT_BLAS)
55static_assert(sizeof(MKL_INT) == 8,
56 "EIGEN_64BIT_BLAS is defined but MKL_INT is 32-bit. Define MKL_ILP64 and link the MKL *_ilp64 "
57 "libraries, or undefine EIGEN_64BIT_BLAS.");
58#else
59static_assert(sizeof(MKL_INT) == 4,
60 "MKL_INT is 64-bit but EIGEN_64BIT_BLAS is not defined. Define EIGEN_64BIT_BLAS to match MKL_ILP64, or "
61 "link the MKL *_lp64 libraries.");
62#endif
63#else
64using BlasIndex = EIGEN_BLAS_INT;
65#endif
66
67} // end namespace Eigen
68
69#endif // EIGEN_BLAS_TYPES_H