Core
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
5 // Copyright (C) 2007-2011 Benoit Jacob <jacob.benoit.1@gmail.com>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_CORE_MODULE_H
12 #define EIGEN_CORE_MODULE_H
13 
14 // first thing Eigen does: stop the compiler from reporting useless warnings.
16 
17 // then include this file where all our macros are defined. It's really important to do it first because
18 // it's where we do all the compiler/OS/arch detections and define most defaults.
19 #include "src/Core/util/Macros.h"
20 
21 // This detects SSE/AVX/NEON/etc. and configure alignment settings
23 
24 // We need cuda_runtime.h/hip_runtime.h to ensure that
25 // the EIGEN_USING_STD macro works properly on the device side
26 #if defined(EIGEN_CUDACC)
27  #include <cuda_runtime.h>
28 #elif defined(EIGEN_HIPCC)
29  #include <hip/hip_runtime.h>
30 #endif
31 
32 
33 #ifdef EIGEN_EXCEPTIONS
34  #include <new>
35 #endif
36 
37 // Disable the ipa-cp-clone optimization flag with MinGW 6.x or older (enabled by default with -O3)
38 // See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556 for details.
39 #if EIGEN_COMP_MINGW && EIGEN_GNUC_STRICT_LESS_THAN(6,0,0)
40  #pragma GCC optimize ("-fno-ipa-cp-clone")
41 #endif
42 
43 // Prevent ICC from specializing std::complex operators that silently fail
44 // on device. This allows us to use our own device-compatible specializations
45 // instead.
46 #if EIGEN_COMP_ICC && defined(EIGEN_GPU_COMPILE_PHASE) \
47  && !defined(_OVERRIDE_COMPLEX_SPECIALIZATION_)
48 #define _OVERRIDE_COMPLEX_SPECIALIZATION_ 1
49 #endif
50 #include <complex>
51 
52 // this include file manages BLAS and MKL related macros
53 // and inclusion of their respective header files
55 
56 
57 #if defined(EIGEN_HAS_CUDA_FP16) || defined(EIGEN_HAS_HIP_FP16)
58  #define EIGEN_HAS_GPU_FP16
59 #endif
60 
61 #if defined(EIGEN_HAS_CUDA_BF16) || defined(EIGEN_HAS_HIP_BF16)
62  #define EIGEN_HAS_GPU_BF16
63 #endif
64 
65 #if (defined _OPENMP) && (!defined EIGEN_DONT_PARALLELIZE)
66  #define EIGEN_HAS_OPENMP
67 #endif
68 
69 #ifdef EIGEN_HAS_OPENMP
70 #include <atomic>
71 #include <omp.h>
72 #endif
73 
74 // MSVC for windows mobile does not have the errno.h file
75 #if !(EIGEN_COMP_MSVC && EIGEN_OS_WINCE) && !EIGEN_COMP_ARM
76 #define EIGEN_HAS_ERRNO
77 #endif
78 
79 #ifdef EIGEN_HAS_ERRNO
80 #include <cerrno>
81 #endif
82 #include <cstddef>
83 #include <cstdlib>
84 #include <cmath>
85 #include <functional>
86 #ifndef EIGEN_NO_IO
87  #include <sstream>
88  #include <iosfwd>
89 #endif
90 #include <cstring>
91 #include <string>
92 #include <limits>
93 #include <climits> // for CHAR_BIT
94 // for min/max:
95 #include <algorithm>
96 
97 #include <array>
98 #include <vector>
99 
100 // for std::is_nothrow_move_assignable
101 #include <type_traits>
102 
103 // for outputting debug info
104 #ifdef EIGEN_DEBUG_ASSIGN
105 #include <iostream>
106 #endif
107 
108 // required for __cpuid, needs to be included after cmath
109 // also required for _BitScanReverse on Windows on ARM
110 #if EIGEN_COMP_MSVC && (EIGEN_ARCH_i386_OR_x86_64 || EIGEN_ARCH_ARM64) && !EIGEN_OS_WINCE
111  #include <intrin.h>
112 #endif
113 
114 #if defined(EIGEN_USE_SYCL)
115  #undef min
116  #undef max
117  #undef isnan
118  #undef isinf
119  #undef isfinite
120  #include <CL/sycl.hpp>
121  #include <map>
122  #include <memory>
123  #include <utility>
124  #include <thread>
125  #ifndef EIGEN_SYCL_LOCAL_THREAD_DIM0
126  #define EIGEN_SYCL_LOCAL_THREAD_DIM0 16
127  #endif
128  #ifndef EIGEN_SYCL_LOCAL_THREAD_DIM1
129  #define EIGEN_SYCL_LOCAL_THREAD_DIM1 16
130  #endif
131 #endif
132 
133 
134 #if defined EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS || defined EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API || defined EIGEN2_SUPPORT_STAGE20_RESOLVE_API_CONFLICTS || defined EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API || defined EIGEN2_SUPPORT
135 // This will generate an error message:
136 #error Eigen2-support is only available up to version 3.2. Please go to "http://eigen.tuxfamily.org/index.php?title=Eigen2" for further information
137 #endif
138 
139 namespace Eigen {
140 
141 // we use size_t frequently and we'll never remember to prepend it with std:: every time just to
142 // ensure QNX/QCC support
143 using std::size_t;
144 // gcc 4.6.0 wants std:: for ptrdiff_t
145 using std::ptrdiff_t;
146 
147 }
148 
159 #ifdef EIGEN_USE_LAPACKE
160  #ifdef EIGEN_USE_MKL
161  #include "mkl_lapacke.h"
162  #else
163  #include "src/misc/lapacke.h"
164  #endif
165 #endif
166 
167 // IWYU pragma: begin_exports
168 #include "src/Core/util/Constants.h"
169 #include "src/Core/util/Meta.h"
170 #include "src/Core/util/Assert.h"
173 #include "src/Core/util/XprHelper.h"
174 #include "src/Core/util/Memory.h"
179 #include "src/Core/util/MoreMeta.h"
180 
181 #include "src/Core/NumTraits.h"
182 #include "src/Core/MathFunctions.h"
186 // Generic half float support
190 
191 #if defined EIGEN_VECTORIZE_AVX512
192  #if defined EIGEN_VECTORIZE_AVX512FP16
194  #endif
197  #include "src/Core/arch/SSE/Complex.h"
200  #include "src/Core/arch/AVX/Complex.h"
208 #elif defined EIGEN_VECTORIZE_AVX
209  // Use AVX for floats and doubles, SSE for integers
212  #include "src/Core/arch/SSE/Complex.h"
215  #include "src/Core/arch/AVX/Complex.h"
218 #elif defined EIGEN_VECTORIZE_SSE
222  #include "src/Core/arch/SSE/Complex.h"
223 #elif defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX)
228 #elif defined EIGEN_VECTORIZE_NEON
233 #elif defined EIGEN_VECTORIZE_SVE
237 #elif defined EIGEN_VECTORIZE_ZVECTOR
241 #elif defined EIGEN_VECTORIZE_MSA
244  #include "src/Core/arch/MSA/Complex.h"
245 #endif
246 
247 #if defined EIGEN_VECTORIZE_GPU
251 #endif
252 
253 #if defined(EIGEN_USE_SYCL)
255 #if !defined(EIGEN_DONT_VECTORIZE_SYCL)
259 #endif
260 #endif
261 
263 // This file provides generic implementations valid for scalar as well
265 
272 
273 // Specialized functors for GPU.
274 #ifdef EIGEN_GPUCC
276 #endif
277 
278 // Specializations of vectorized activation functions for NEON.
279 #ifdef EIGEN_VECTORIZE_NEON
281 #endif
282 
286 #ifndef EIGEN_NO_IO
287  #include "src/Core/IO.h"
288 #endif
290 #include "src/Core/DenseBase.h"
291 #include "src/Core/MatrixBase.h"
292 #include "src/Core/EigenBase.h"
293 
294 #include "src/Core/Product.h"
295 #include "src/Core/CoreEvaluators.h"
297 
298 #ifndef EIGEN_PARSED_BY_DOXYGEN // work around Doxygen bug triggered by Assign.h r814874
299  // at least confirmed with Doxygen 1.5.5 and 1.5.6
300  #include "src/Core/Assign.h"
301 #endif
302 
303 #include "src/Core/ArrayBase.h"
304 #include "src/Core/util/BlasUtil.h"
305 #include "src/Core/DenseStorage.h"
306 #include "src/Core/NestByValue.h"
307 
308 // #include "src/Core/ForceAlignedAccess.h"
309 
310 #include "src/Core/ReturnByValue.h"
311 #include "src/Core/NoAlias.h"
313 #include "src/Core/Matrix.h"
314 #include "src/Core/Array.h"
315 #include "src/Core/CwiseTernaryOp.h"
316 #include "src/Core/CwiseBinaryOp.h"
317 #include "src/Core/CwiseUnaryOp.h"
318 #include "src/Core/CwiseNullaryOp.h"
319 #include "src/Core/CwiseUnaryView.h"
321 #include "src/Core/Dot.h"
322 #include "src/Core/StableNorm.h"
323 #include "src/Core/Stride.h"
324 #include "src/Core/MapBase.h"
325 #include "src/Core/Map.h"
326 #include "src/Core/Ref.h"
327 #include "src/Core/Block.h"
328 #include "src/Core/VectorBlock.h"
329 #include "src/Core/IndexedView.h"
330 #include "src/Core/Reshaped.h"
331 #include "src/Core/Transpose.h"
332 #include "src/Core/DiagonalMatrix.h"
333 #include "src/Core/Diagonal.h"
336 #include "src/Core/Redux.h"
337 #include "src/Core/Visitor.h"
338 #include "src/Core/Fuzzy.h"
339 #include "src/Core/Swap.h"
341 #include "src/Core/GeneralProduct.h"
342 #include "src/Core/Solve.h"
343 #include "src/Core/Inverse.h"
344 #include "src/Core/SolverBase.h"
346 #include "src/Core/Transpositions.h"
364 #include "src/Core/BandMatrix.h"
365 #include "src/Core/CoreIterators.h"
367 
368 #if defined(EIGEN_VECTORIZE_VSX)
370 #elif defined EIGEN_VECTORIZE_NEON
372 #endif
373 
374 #if defined(EIGEN_VECTORIZE_AVX512)
376 #endif
377 
378 #include "src/Core/Select.h"
379 #include "src/Core/VectorwiseOp.h"
381 #include "src/Core/Random.h"
382 #include "src/Core/Replicate.h"
383 #include "src/Core/Reverse.h"
384 #include "src/Core/ArrayWrapper.h"
385 #include "src/Core/StlIterators.h"
386 
387 #ifdef EIGEN_USE_BLAS
396 #endif // EIGEN_USE_BLAS
397 
398 #ifdef EIGEN_USE_MKL_VML
399 #include "src/Core/Assign_MKL.h"
400 #endif
401 
403 // IWYU pragma: end_exports
404 
406 
407 #endif // EIGEN_CORE_MODULE_H
: InteropHeaders
Definition: Core:139