Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/eigen3/Eigen/Core is written in an unsupported language. File is not indexed.

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
0005 // Copyright (C) 2007-2011 Benoit Jacob <jacob.benoit.1@gmail.com>
0006 //
0007 // This Source Code Form is subject to the terms of the Mozilla
0008 // Public License v. 2.0. If a copy of the MPL was not distributed
0009 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0010 
0011 #ifndef EIGEN_CORE_H
0012 #define EIGEN_CORE_H
0013 
0014 // first thing Eigen does: stop the compiler from reporting useless warnings.
0015 #include "src/Core/util/DisableStupidWarnings.h"
0016 
0017 // then include this file where all our macros are defined. It's really important to do it first because
0018 // it's where we do all the compiler/OS/arch detections and define most defaults.
0019 #include "src/Core/util/Macros.h"
0020 
0021 // This detects SSE/AVX/NEON/etc. and configure alignment settings
0022 #include "src/Core/util/ConfigureVectorization.h"
0023 
0024 // We need cuda_runtime.h/hip_runtime.h to ensure that
0025 // the EIGEN_USING_STD macro works properly on the device side
0026 #if defined(EIGEN_CUDACC)
0027   #include <cuda_runtime.h>
0028 #elif defined(EIGEN_HIPCC)
0029   #include <hip/hip_runtime.h>
0030 #endif
0031 
0032 
0033 #ifdef EIGEN_EXCEPTIONS
0034   #include <new>
0035 #endif
0036 
0037 // Disable the ipa-cp-clone optimization flag with MinGW 6.x or newer (enabled by default with -O3)
0038 // See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556 for details.
0039 #if EIGEN_COMP_MINGW && EIGEN_GNUC_AT_LEAST(4,6) && EIGEN_GNUC_AT_MOST(5,5)
0040   #pragma GCC optimize ("-fno-ipa-cp-clone")
0041 #endif
0042 
0043 // Prevent ICC from specializing std::complex operators that silently fail
0044 // on device. This allows us to use our own device-compatible specializations
0045 // instead.
0046 #if defined(EIGEN_COMP_ICC) && defined(EIGEN_GPU_COMPILE_PHASE) \
0047     && !defined(_OVERRIDE_COMPLEX_SPECIALIZATION_)
0048 #define _OVERRIDE_COMPLEX_SPECIALIZATION_ 1
0049 #endif
0050 #include <complex>
0051 
0052 // this include file manages BLAS and MKL related macros
0053 // and inclusion of their respective header files
0054 #include "src/Core/util/MKL_support.h"
0055 
0056 
0057 #if defined(EIGEN_HAS_CUDA_FP16) || defined(EIGEN_HAS_HIP_FP16)
0058   #define EIGEN_HAS_GPU_FP16
0059 #endif
0060 
0061 #if defined(EIGEN_HAS_CUDA_BF16) || defined(EIGEN_HAS_HIP_BF16)
0062   #define EIGEN_HAS_GPU_BF16
0063 #endif
0064 
0065 #if (defined _OPENMP) && (!defined EIGEN_DONT_PARALLELIZE)
0066   #define EIGEN_HAS_OPENMP
0067 #endif
0068 
0069 #ifdef EIGEN_HAS_OPENMP
0070 #include <omp.h>
0071 #endif
0072 
0073 // MSVC for windows mobile does not have the errno.h file
0074 #if !(EIGEN_COMP_MSVC && EIGEN_OS_WINCE) && !EIGEN_COMP_ARM
0075 #define EIGEN_HAS_ERRNO
0076 #endif
0077 
0078 #ifdef EIGEN_HAS_ERRNO
0079 #include <cerrno>
0080 #endif
0081 #include <cstddef>
0082 #include <cstdlib>
0083 #include <cmath>
0084 #include <cassert>
0085 #include <functional>
0086 #include <sstream>
0087 #ifndef EIGEN_NO_IO
0088   #include <iosfwd>
0089 #endif
0090 #include <cstring>
0091 #include <string>
0092 #include <limits>
0093 #include <climits> // for CHAR_BIT
0094 // for min/max:
0095 #include <algorithm>
0096 
0097 #if EIGEN_HAS_CXX11
0098 #include <array>
0099 #endif
0100 
0101 // for std::is_nothrow_move_assignable
0102 #ifdef EIGEN_INCLUDE_TYPE_TRAITS
0103 #include <type_traits>
0104 #endif
0105 
0106 // for outputting debug info
0107 #ifdef EIGEN_DEBUG_ASSIGN
0108 #include <iostream>
0109 #endif
0110 
0111 // required for __cpuid, needs to be included after cmath
0112 #if EIGEN_COMP_MSVC && EIGEN_ARCH_i386_OR_x86_64 && !EIGEN_OS_WINCE
0113   #include <intrin.h>
0114 #endif
0115 
0116 #if defined(EIGEN_USE_SYCL)
0117   #undef min
0118   #undef max
0119   #undef isnan
0120   #undef isinf
0121   #undef isfinite
0122   #include <CL/sycl.hpp>
0123   #include <map>
0124   #include <memory>
0125   #include <utility>
0126   #include <thread>
0127   #ifndef EIGEN_SYCL_LOCAL_THREAD_DIM0
0128   #define EIGEN_SYCL_LOCAL_THREAD_DIM0 16
0129   #endif
0130   #ifndef EIGEN_SYCL_LOCAL_THREAD_DIM1
0131   #define EIGEN_SYCL_LOCAL_THREAD_DIM1 16
0132   #endif
0133 #endif
0134 
0135 
0136 #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
0137 // This will generate an error message:
0138 #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
0139 #endif
0140 
0141 namespace Eigen {
0142 
0143 // we use size_t frequently and we'll never remember to prepend it with std:: every time just to
0144 // ensure QNX/QCC support
0145 using std::size_t;
0146 // gcc 4.6.0 wants std:: for ptrdiff_t
0147 using std::ptrdiff_t;
0148 
0149 }
0150 
0151 /** \defgroup Core_Module Core module
0152   * This is the main module of Eigen providing dense matrix and vector support
0153   * (both fixed and dynamic size) with all the features corresponding to a BLAS library
0154   * and much more...
0155   *
0156   * \code
0157   * #include <Eigen/Core>
0158   * \endcode
0159   */
0160 
0161 #include "src/Core/util/Constants.h"
0162 #include "src/Core/util/Meta.h"
0163 #include "src/Core/util/ForwardDeclarations.h"
0164 #include "src/Core/util/StaticAssert.h"
0165 #include "src/Core/util/XprHelper.h"
0166 #include "src/Core/util/Memory.h"
0167 #include "src/Core/util/IntegralConstant.h"
0168 #include "src/Core/util/SymbolicIndex.h"
0169 
0170 #include "src/Core/NumTraits.h"
0171 #include "src/Core/MathFunctions.h"
0172 #include "src/Core/GenericPacketMath.h"
0173 #include "src/Core/MathFunctionsImpl.h"
0174 #include "src/Core/arch/Default/ConjHelper.h"
0175 // Generic half float support
0176 #include "src/Core/arch/Default/Half.h"
0177 #include "src/Core/arch/Default/BFloat16.h"
0178 #include "src/Core/arch/Default/TypeCasting.h"
0179 #include "src/Core/arch/Default/GenericPacketMathFunctionsFwd.h"
0180 
0181 #if defined EIGEN_VECTORIZE_AVX512
0182   #include "src/Core/arch/SSE/PacketMath.h"
0183   #include "src/Core/arch/SSE/TypeCasting.h"
0184   #include "src/Core/arch/SSE/Complex.h"
0185   #include "src/Core/arch/AVX/PacketMath.h"
0186   #include "src/Core/arch/AVX/TypeCasting.h"
0187   #include "src/Core/arch/AVX/Complex.h"
0188   #include "src/Core/arch/AVX512/PacketMath.h"
0189   #include "src/Core/arch/AVX512/TypeCasting.h"
0190   #include "src/Core/arch/AVX512/Complex.h"
0191   #include "src/Core/arch/SSE/MathFunctions.h"
0192   #include "src/Core/arch/AVX/MathFunctions.h"
0193   #include "src/Core/arch/AVX512/MathFunctions.h"
0194 #elif defined EIGEN_VECTORIZE_AVX
0195   // Use AVX for floats and doubles, SSE for integers
0196   #include "src/Core/arch/SSE/PacketMath.h"
0197   #include "src/Core/arch/SSE/TypeCasting.h"
0198   #include "src/Core/arch/SSE/Complex.h"
0199   #include "src/Core/arch/AVX/PacketMath.h"
0200   #include "src/Core/arch/AVX/TypeCasting.h"
0201   #include "src/Core/arch/AVX/Complex.h"
0202   #include "src/Core/arch/SSE/MathFunctions.h"
0203   #include "src/Core/arch/AVX/MathFunctions.h"
0204 #elif defined EIGEN_VECTORIZE_SSE
0205   #include "src/Core/arch/SSE/PacketMath.h"
0206   #include "src/Core/arch/SSE/TypeCasting.h"
0207   #include "src/Core/arch/SSE/MathFunctions.h"
0208   #include "src/Core/arch/SSE/Complex.h"
0209 #elif defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX)
0210   #include "src/Core/arch/AltiVec/PacketMath.h"
0211   #include "src/Core/arch/AltiVec/MathFunctions.h"
0212   #include "src/Core/arch/AltiVec/Complex.h"
0213 #elif defined EIGEN_VECTORIZE_NEON
0214   #include "src/Core/arch/NEON/PacketMath.h"
0215   #include "src/Core/arch/NEON/TypeCasting.h"
0216   #include "src/Core/arch/NEON/MathFunctions.h"
0217   #include "src/Core/arch/NEON/Complex.h"
0218 #elif defined EIGEN_VECTORIZE_SVE
0219   #include "src/Core/arch/SVE/PacketMath.h"
0220   #include "src/Core/arch/SVE/TypeCasting.h"
0221   #include "src/Core/arch/SVE/MathFunctions.h"
0222 #elif defined EIGEN_VECTORIZE_ZVECTOR
0223   #include "src/Core/arch/ZVector/PacketMath.h"
0224   #include "src/Core/arch/ZVector/MathFunctions.h"
0225   #include "src/Core/arch/ZVector/Complex.h"
0226 #elif defined EIGEN_VECTORIZE_MSA
0227   #include "src/Core/arch/MSA/PacketMath.h"
0228   #include "src/Core/arch/MSA/MathFunctions.h"
0229   #include "src/Core/arch/MSA/Complex.h"
0230 #endif
0231 
0232 #if defined EIGEN_VECTORIZE_GPU
0233   #include "src/Core/arch/GPU/PacketMath.h"
0234   #include "src/Core/arch/GPU/MathFunctions.h"
0235   #include "src/Core/arch/GPU/TypeCasting.h"
0236 #endif
0237 
0238 #if defined(EIGEN_USE_SYCL)
0239   #include "src/Core/arch/SYCL/SyclMemoryModel.h"
0240   #include "src/Core/arch/SYCL/InteropHeaders.h"
0241 #if !defined(EIGEN_DONT_VECTORIZE_SYCL)
0242   #include "src/Core/arch/SYCL/PacketMath.h"
0243   #include "src/Core/arch/SYCL/MathFunctions.h"
0244   #include "src/Core/arch/SYCL/TypeCasting.h"
0245 #endif
0246 #endif
0247 
0248 #include "src/Core/arch/Default/Settings.h"
0249 // This file provides generic implementations valid for scalar as well
0250 #include "src/Core/arch/Default/GenericPacketMathFunctions.h"
0251 
0252 #include "src/Core/functors/TernaryFunctors.h"
0253 #include "src/Core/functors/BinaryFunctors.h"
0254 #include "src/Core/functors/UnaryFunctors.h"
0255 #include "src/Core/functors/NullaryFunctors.h"
0256 #include "src/Core/functors/StlFunctors.h"
0257 #include "src/Core/functors/AssignmentFunctors.h"
0258 
0259 // Specialized functors to enable the processing of complex numbers
0260 // on CUDA devices
0261 #ifdef EIGEN_CUDACC
0262 #include "src/Core/arch/CUDA/Complex.h"
0263 #endif
0264 
0265 #include "src/Core/util/IndexedViewHelper.h"
0266 #include "src/Core/util/ReshapedHelper.h"
0267 #include "src/Core/ArithmeticSequence.h"
0268 #ifndef EIGEN_NO_IO
0269   #include "src/Core/IO.h"
0270 #endif
0271 #include "src/Core/DenseCoeffsBase.h"
0272 #include "src/Core/DenseBase.h"
0273 #include "src/Core/MatrixBase.h"
0274 #include "src/Core/EigenBase.h"
0275 
0276 #include "src/Core/Product.h"
0277 #include "src/Core/CoreEvaluators.h"
0278 #include "src/Core/AssignEvaluator.h"
0279 
0280 #ifndef EIGEN_PARSED_BY_DOXYGEN // work around Doxygen bug triggered by Assign.h r814874
0281                                 // at least confirmed with Doxygen 1.5.5 and 1.5.6
0282   #include "src/Core/Assign.h"
0283 #endif
0284 
0285 #include "src/Core/ArrayBase.h"
0286 #include "src/Core/util/BlasUtil.h"
0287 #include "src/Core/DenseStorage.h"
0288 #include "src/Core/NestByValue.h"
0289 
0290 // #include "src/Core/ForceAlignedAccess.h"
0291 
0292 #include "src/Core/ReturnByValue.h"
0293 #include "src/Core/NoAlias.h"
0294 #include "src/Core/PlainObjectBase.h"
0295 #include "src/Core/Matrix.h"
0296 #include "src/Core/Array.h"
0297 #include "src/Core/CwiseTernaryOp.h"
0298 #include "src/Core/CwiseBinaryOp.h"
0299 #include "src/Core/CwiseUnaryOp.h"
0300 #include "src/Core/CwiseNullaryOp.h"
0301 #include "src/Core/CwiseUnaryView.h"
0302 #include "src/Core/SelfCwiseBinaryOp.h"
0303 #include "src/Core/Dot.h"
0304 #include "src/Core/StableNorm.h"
0305 #include "src/Core/Stride.h"
0306 #include "src/Core/MapBase.h"
0307 #include "src/Core/Map.h"
0308 #include "src/Core/Ref.h"
0309 #include "src/Core/Block.h"
0310 #include "src/Core/VectorBlock.h"
0311 #include "src/Core/IndexedView.h"
0312 #include "src/Core/Reshaped.h"
0313 #include "src/Core/Transpose.h"
0314 #include "src/Core/DiagonalMatrix.h"
0315 #include "src/Core/Diagonal.h"
0316 #include "src/Core/DiagonalProduct.h"
0317 #include "src/Core/Redux.h"
0318 #include "src/Core/Visitor.h"
0319 #include "src/Core/Fuzzy.h"
0320 #include "src/Core/Swap.h"
0321 #include "src/Core/CommaInitializer.h"
0322 #include "src/Core/GeneralProduct.h"
0323 #include "src/Core/Solve.h"
0324 #include "src/Core/Inverse.h"
0325 #include "src/Core/SolverBase.h"
0326 #include "src/Core/PermutationMatrix.h"
0327 #include "src/Core/Transpositions.h"
0328 #include "src/Core/TriangularMatrix.h"
0329 #include "src/Core/SelfAdjointView.h"
0330 #include "src/Core/products/GeneralBlockPanelKernel.h"
0331 #include "src/Core/products/Parallelizer.h"
0332 #include "src/Core/ProductEvaluators.h"
0333 #include "src/Core/products/GeneralMatrixVector.h"
0334 #include "src/Core/products/GeneralMatrixMatrix.h"
0335 #include "src/Core/SolveTriangular.h"
0336 #include "src/Core/products/GeneralMatrixMatrixTriangular.h"
0337 #include "src/Core/products/SelfadjointMatrixVector.h"
0338 #include "src/Core/products/SelfadjointMatrixMatrix.h"
0339 #include "src/Core/products/SelfadjointProduct.h"
0340 #include "src/Core/products/SelfadjointRank2Update.h"
0341 #include "src/Core/products/TriangularMatrixVector.h"
0342 #include "src/Core/products/TriangularMatrixMatrix.h"
0343 #include "src/Core/products/TriangularSolverMatrix.h"
0344 #include "src/Core/products/TriangularSolverVector.h"
0345 #include "src/Core/BandMatrix.h"
0346 #include "src/Core/CoreIterators.h"
0347 #include "src/Core/ConditionEstimator.h"
0348 
0349 #if defined(EIGEN_VECTORIZE_ALTIVEC) || defined(EIGEN_VECTORIZE_VSX)
0350   #include "src/Core/arch/AltiVec/MatrixProduct.h"
0351 #elif defined EIGEN_VECTORIZE_NEON
0352   #include "src/Core/arch/NEON/GeneralBlockPanelKernel.h"
0353 #endif
0354 
0355 #include "src/Core/BooleanRedux.h"
0356 #include "src/Core/Select.h"
0357 #include "src/Core/VectorwiseOp.h"
0358 #include "src/Core/PartialReduxEvaluator.h"
0359 #include "src/Core/Random.h"
0360 #include "src/Core/Replicate.h"
0361 #include "src/Core/Reverse.h"
0362 #include "src/Core/ArrayWrapper.h"
0363 #include "src/Core/StlIterators.h"
0364 
0365 #ifdef EIGEN_USE_BLAS
0366 #include "src/Core/products/GeneralMatrixMatrix_BLAS.h"
0367 #include "src/Core/products/GeneralMatrixVector_BLAS.h"
0368 #include "src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h"
0369 #include "src/Core/products/SelfadjointMatrixMatrix_BLAS.h"
0370 #include "src/Core/products/SelfadjointMatrixVector_BLAS.h"
0371 #include "src/Core/products/TriangularMatrixMatrix_BLAS.h"
0372 #include "src/Core/products/TriangularMatrixVector_BLAS.h"
0373 #include "src/Core/products/TriangularSolverMatrix_BLAS.h"
0374 #endif // EIGEN_USE_BLAS
0375 
0376 #ifdef EIGEN_USE_MKL_VML
0377 #include "src/Core/Assign_MKL.h"
0378 #endif
0379 
0380 #include "src/Core/GlobalFunctions.h"
0381 
0382 #include "src/Core/util/ReenableStupidWarnings.h"
0383 
0384 #endif // EIGEN_CORE_H