Eigen-Contrib  5.0.1
 
Loading...
Searching...
No Matches
Tensor
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
5// Copyright (C) 2013 Christian Seiler <christian@iwakd.de>
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// SPDX-License-Identifier: MPL-2.0
11
12// A later inclusion can complete a device type after its backend macro is
13// enabled. Backend evaluation still requires the macro before including Eigen.
14#if !defined(EIGEN_TENSOR_MODULE_H) || (defined(EIGEN_USE_THREADS) && !defined(EIGEN_TENSOR_MODULE_THREADS_LOADED)) || \
15 (defined(EIGEN_USE_GPU) && !defined(EIGEN_TENSOR_MODULE_GPU_LOADED)) || \
16 (defined(EIGEN_USE_SYCL) && !defined(EIGEN_TENSOR_MODULE_SYCL_LOADED))
17#define EIGEN_TENSOR_MODULE_H
18
19// Record caller-provided backend macros before any included header can change
20// them, so later inclusions detect only backends newly enabled by the caller.
21#ifdef EIGEN_USE_THREADS
22#define EIGEN_TENSOR_MODULE_THREADS_LOADED
23#endif
24#ifdef EIGEN_USE_GPU
25#define EIGEN_TENSOR_MODULE_GPU_LOADED
26#endif
27#ifdef EIGEN_USE_SYCL
28#define EIGEN_TENSOR_MODULE_SYCL_LOADED
29#endif
30
31#include "../../Eigen/Core"
32
33#include "SpecialFunctions"
34
35#include "../../Eigen/src/Core/util/DisableStupidWarnings.h"
36
37// IWYU pragma: begin_exports
38#include "../../Eigen/src/Core/util/Meta.h"
39#include "../../Eigen/src/Core/util/MaxSizeVector.h"
40// IWYU pragma: end_exports
41
53
54#include <atomic>
55#include <chrono>
56#include <cmath>
57#include <cstddef>
58#include <cstring>
59#include <iterator>
60#include <numeric>
61#include <random>
62#include <thread>
63
64#if defined(EIGEN_USE_THREADS) || defined(EIGEN_USE_SYCL)
65#include "../../Eigen/ThreadPool"
66#endif
67
68#ifdef EIGEN_USE_GPU
69#include <iostream>
70#if defined(EIGEN_USE_HIP)
71#include <hip/hip_runtime.h>
72#else
73#include <cuda_runtime.h>
74#endif
75#endif
76
77// IWYU pragma: begin_exports
78#include "src/Tensor/TensorMacros.h"
79#include "src/Tensor/TensorForwardDeclarations.h"
80#include "src/Tensor/TensorMeta.h"
81#include "src/Tensor/TensorFunctors.h"
82#include "src/Tensor/TensorCostModel.h"
83#include "src/Tensor/TensorDeviceDefault.h"
84#include "src/Tensor/TensorDeviceThreadPool.h"
85#include "src/Tensor/TensorDeviceGpu.h"
86#include "src/Tensor/TensorDeviceSycl.h"
87#include "src/Tensor/TensorIndexList.h"
88#include "src/Tensor/TensorDimensionList.h"
89#include "src/Tensor/TensorDimensions.h"
90#include "src/Tensor/TensorInitializer.h"
91#include "src/Tensor/TensorTraits.h"
92#include "src/Tensor/TensorRandom.h"
93#include "src/Tensor/TensorUInt128.h"
94#include "src/Tensor/TensorIntDiv.h"
95#include "src/Tensor/TensorGlobalFunctions.h"
96
97#include "src/Tensor/TensorIO.h"
98
99#include "src/Tensor/TensorBase.h"
100#include "src/Tensor/TensorBlock.h"
101
102#include "src/Tensor/TensorEvaluator.h"
103#include "src/Tensor/TensorExpr.h"
104#include "src/Tensor/TensorReduction.h"
105#include "src/Tensor/TensorReductionGpu.h"
106#include "src/Tensor/TensorArgMax.h"
107#include "src/Tensor/TensorConcatenation.h"
108#include "src/Tensor/TensorContractionMapper.h"
109#include "src/Tensor/TensorContractionBlocking.h"
110#include "src/Tensor/TensorContraction.h"
111#include "src/Tensor/TensorContractionThreadPool.h"
112#include "src/Tensor/TensorContractionGpu.h"
113#include "src/Tensor/TensorConversion.h"
114#include "src/Tensor/TensorConvolution.h"
115#include "src/Tensor/TensorFFT.h"
116#include "src/Tensor/TensorPatch.h"
117#include "src/Tensor/TensorImagePatch.h"
118#include "src/Tensor/TensorVolumePatch.h"
119#include "src/Tensor/TensorBroadcasting.h"
120#include "src/Tensor/TensorChipping.h"
121#include "src/Tensor/TensorInflation.h"
122#include "src/Tensor/TensorLayoutSwap.h"
123#include "src/Tensor/TensorMorphing.h"
124#include "src/Tensor/TensorPadding.h"
125#include "src/Tensor/TensorReverse.h"
126#include "src/Tensor/TensorRoll.h"
127#include "src/Tensor/TensorShuffling.h"
128#include "src/Tensor/TensorStriding.h"
129#include "src/Tensor/TensorCustomOp.h"
130#include "src/Tensor/TensorEvalTo.h"
131#include "src/Tensor/TensorForcedEval.h"
132#include "src/Tensor/TensorGenerator.h"
133#include "src/Tensor/TensorAssign.h"
134#include "src/Tensor/TensorScan.h"
135#include "src/Tensor/TensorTrace.h"
136
137#ifdef EIGEN_USE_SYCL
138#include "src/Tensor/TensorReductionSycl.h"
139#include "src/Tensor/TensorConvolutionSycl.h"
140#include "src/Tensor/TensorContractionSycl.h"
141#include "src/Tensor/TensorScanSycl.h"
142#endif
143
144#include "src/Tensor/TensorExecutor.h"
145#include "src/Tensor/TensorDevice.h"
146
147#include "src/Tensor/TensorStorage.h"
148#include "src/Tensor/Tensor.h"
149#include "src/Tensor/TensorFixedSize.h"
150#include "src/Tensor/TensorMap.h"
151#include "src/Tensor/TensorRef.h"
152// IWYU pragma: end_exports
153
154#include "../../Eigen/src/Core/util/ReenableStupidWarnings.h"
155
156#endif // Tensor module or newly enabled backend