TR-mbed 1.0
Loading...
Searching...
No Matches
TensorForwardDeclarations.h
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) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
10#ifndef EIGEN_CXX11_TENSOR_TENSOR_FORWARD_DECLARATIONS_H
11#define EIGEN_CXX11_TENSOR_TENSOR_FORWARD_DECLARATIONS_H
12
13namespace Eigen {
14
15// MakePointer class is used as a container of the address space of the pointer
16// on the host and on the device. From the host side it generates the T* pointer
17// and when EIGEN_USE_SYCL is used it construct a buffer with a map_allocator to
18// T* m_data on the host. It is always called on the device.
19// Specialisation of MakePointer class for creating the sycl buffer with
20// map_allocator.
21template<typename T> struct MakePointer {
22 typedef T* Type;
23 typedef const T* ConstType;
24};
25
26template <typename T>
28 return const_cast<T*>(data);
29}
30
31// The StorageMemory class is a container of the device specific pointer
32// used for refering to a Pointer on TensorEvaluator class. While the TensorExpression
33// is a device-agnostic type and need MakePointer class for type conversion,
34// the TensorEvaluator class can be specialized for a device, hence it is possible
35// to construct different types of temproray storage memory in TensorEvaluator
36// for different devices by specializing the following StorageMemory class.
37template<typename T, typename device> struct StorageMemory: MakePointer <T> {};
38
39namespace internal{
40template<typename A, typename B> struct Pointer_type_promotion {
41 static const bool val=false;
42};
43template<typename A> struct Pointer_type_promotion<A, A> {
44 static const bool val = true;
45};
46template<typename A, typename B> struct TypeConversion {
47 typedef A* type;
48};
49}
50
51
52template<typename PlainObjectType, int Options_ = Unaligned, template <class> class MakePointer_ = MakePointer> class TensorMap;
53template<typename Scalar_, int NumIndices_, int Options_ = 0, typename IndexType = DenseIndex> class Tensor;
54template<typename Scalar_, typename Dimensions, int Options_ = 0, typename IndexType = DenseIndex> class TensorFixedSize;
55template<typename PlainObjectType> class TensorRef;
56template<typename Derived, int AccessLevel> class TensorBase;
57
58template<typename NullaryOp, typename PlainObjectType> class TensorCwiseNullaryOp;
59template<typename UnaryOp, typename XprType> class TensorCwiseUnaryOp;
60template<typename BinaryOp, typename LeftXprType, typename RightXprType> class TensorCwiseBinaryOp;
61template<typename TernaryOp, typename Arg1XprType, typename Arg2XprType, typename Arg3XprType> class TensorCwiseTernaryOp;
62template<typename IfXprType, typename ThenXprType, typename ElseXprType> class TensorSelectOp;
63template<typename Op, typename Dims, typename XprType, template <class> class MakePointer_ = MakePointer > class TensorReductionOp;
64template<typename XprType> class TensorIndexTupleOp;
65template<typename ReduceOp, typename Dims, typename XprType> class TensorTupleReducerOp;
66template<typename Axis, typename LeftXprType, typename RightXprType> class TensorConcatenationOp;
67template<typename Dimensions, typename LeftXprType, typename RightXprType, typename OutputKernelType> class TensorContractionOp;
68template<typename TargetType, typename XprType> class TensorConversionOp;
69template<typename Dimensions, typename InputXprType, typename KernelXprType> class TensorConvolutionOp;
70template<typename FFT, typename XprType, int FFTDataType, int FFTDirection> class TensorFFTOp;
71template<typename PatchDim, typename XprType> class TensorPatchOp;
72template<DenseIndex Rows, DenseIndex Cols, typename XprType> class TensorImagePatchOp;
73template<DenseIndex Planes, DenseIndex Rows, DenseIndex Cols, typename XprType> class TensorVolumePatchOp;
74template<typename Broadcast, typename XprType> class TensorBroadcastingOp;
75template<DenseIndex DimId, typename XprType> class TensorChippingOp;
76template<typename NewDimensions, typename XprType> class TensorReshapingOp;
77template<typename XprType> class TensorLayoutSwapOp;
78template<typename StartIndices, typename Sizes, typename XprType> class TensorSlicingOp;
79template<typename ReverseDimensions, typename XprType> class TensorReverseOp;
80template<typename PaddingDimensions, typename XprType> class TensorPaddingOp;
81template<typename Shuffle, typename XprType> class TensorShufflingOp;
82template<typename Strides, typename XprType> class TensorStridingOp;
83template<typename StartIndices, typename StopIndices, typename Strides, typename XprType> class TensorStridingSlicingOp;
84template<typename Strides, typename XprType> class TensorInflationOp;
85template<typename Generator, typename XprType> class TensorGeneratorOp;
86template<typename LeftXprType, typename RightXprType> class TensorAssignOp;
87template<typename Op, typename XprType> class TensorScanOp;
88template<typename Dims, typename XprType> class TensorTraceOp;
89
90template<typename CustomUnaryFunc, typename XprType> class TensorCustomUnaryOp;
91template<typename CustomBinaryFunc, typename LhsXprType, typename RhsXprType> class TensorCustomBinaryOp;
92
93template<typename XprType, template <class> class MakePointer_ = MakePointer> class TensorEvalToOp;
94template<typename XprType> class TensorForcedEvalOp;
95
96template<typename ExpressionType, typename DeviceType> class TensorDevice;
97template<typename ExpressionType, typename DeviceType, typename DoneCallback> class TensorAsyncDevice;
98template<typename Derived, typename Device> struct TensorEvaluator;
99
100struct NoOpOutputKernel;
101
102struct DefaultDevice;
103struct ThreadPoolDevice;
104struct GpuDevice;
105struct SyclDevice;
106
107#ifdef EIGEN_USE_SYCL
108
109template <typename T> struct MakeSYCLPointer {
110 typedef Eigen::TensorSycl::internal::RangeAccess<cl::sycl::access::mode::read_write, T> Type;
111};
112
113template <typename T>
114EIGEN_STRONG_INLINE const Eigen::TensorSycl::internal::RangeAccess<cl::sycl::access::mode::read_write, T>&
115constCast(const Eigen::TensorSycl::internal::RangeAccess<cl::sycl::access::mode::read_write, T>& data) {
116 return data;
117}
118
119template <typename T>
120struct StorageMemory<T, SyclDevice> : MakeSYCLPointer<T> {};
121template <typename T>
122struct StorageMemory<T, const SyclDevice> : StorageMemory<T, SyclDevice> {};
123
124namespace TensorSycl {
125namespace internal{
126template <typename Evaluator, typename Op> class GenericNondeterministicReducer;
127}
128}
129#endif
130
131
137
142
143
144namespace internal {
145
146template <typename Device, typename Expression>
150
151template <typename Expression>
156
157// Tiled evaluation strategy.
159 Off = 0, // tiled evaluation is not supported
160 On = 1, // still work in progress (see TensorBlock.h)
161};
162
163template <typename Device, typename Expression>
165 // Check that block evaluation is supported and it's a preferred option (at
166 // least one sub-expression has much faster block evaluation, e.g.
167 // broadcasting).
168 static const bool BlockAccess =
171
172 static const TiledEvaluation value =
174};
175
176template <typename Expression, typename Device,
179class TensorExecutor;
180
181template <typename Expression, typename Device, typename DoneCallback,
185
186
187} // end namespace internal
188
189} // end namespace Eigen
190
191#endif // EIGEN_CXX11_TENSOR_TENSOR_FORWARD_DECLARATIONS_H
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define EIGEN_STRONG_INLINE
Definition Macros.h:917
int data[]
Definition Map_placement_new.cpp:1
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
Definition TensorAssign.h:62
Pseudo expression providing an operator = that will evaluate its argument asynchronously on the speci...
Definition TensorDevice.h:83
The tensor base class.
Definition TensorBase.h:973
Definition TensorBroadcasting.h:70
Definition TensorChipping.h:81
Tensor concatenation class.
Definition TensorConcatenation.h:61
Definition TensorContraction.h:326
Tensor conversion class. This class makes it possible to vectorize type casting operations when the n...
Definition TensorConversion.h:177
Definition TensorConvolution.h:260
Tensor custom class.
Definition TensorCustomOp.h:220
Tensor custom class.
Definition TensorCustomOp.h:54
Definition TensorExpr.h:197
Definition TensorExpr.h:53
Definition TensorExpr.h:279
Definition TensorExpr.h:116
Pseudo expression providing an operator = that will evaluate its argument on the specified computing ...
Definition TensorDevice.h:27
Definition TensorEvalTo.h:69
Definition TensorFFT.h:86
The fixed sized version of the tensor class.
Definition TensorFixedSize.h:28
Definition TensorForcedEval.h:60
Tensor generator class.
Definition TensorGenerator.h:55
Definition TensorImagePatch.h:121
Definition TensorArgMax.h:54
Definition TensorInflation.h:53
Definition TensorLayoutSwap.h:70
A tensor expression mapping an existing array of data.
Definition TensorMap.h:30
Definition TensorPadding.h:55
Definition TensorPatch.h:55
Definition TensorReduction.h:471
A reference to a tensor expression The expression will be evaluated lazily (as much as possible).
Definition TensorRef.h:125
Definition TensorMorphing.h:55
Definition TensorReverse.h:55
Definition TensorScan.h:51
Definition TensorExpr.h:353
Definition TensorShuffling.h:55
Definition TensorMorphing.h:342
Definition TensorStriding.h:55
Definition TensorMorphing.h:837
Definition TensorTrace.h:55
Definition TensorArgMax.h:177
Definition TensorVolumePatch.h:57
The tensor class.
Definition Tensor.h:64
Definition TensorExecutor.h:116
Definition TensorExecutor.h:81
TiledEvaluation
Definition TensorForwardDeclarations.h:158
@ Off
Definition TensorForwardDeclarations.h:159
@ On
Definition TensorForwardDeclarations.h:160
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
FFTDirection
Definition TensorForwardDeclarations.h:138
@ FFT_FORWARD
Definition TensorForwardDeclarations.h:139
@ FFT_REVERSE
Definition TensorForwardDeclarations.h:140
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T * constCast(const T *data)
Definition TensorForwardDeclarations.h:27
FFTResultType
Definition TensorForwardDeclarations.h:132
@ ImagPart
Definition TensorForwardDeclarations.h:134
@ BothParts
Definition TensorForwardDeclarations.h:135
@ RealPart
Definition TensorForwardDeclarations.h:133
Definition BandTriangularSolver.h:13
Definition TensorDeviceDefault.h:17
Definition TensorForwardDeclarations.h:21
const T * ConstType
Definition TensorForwardDeclarations.h:23
T * Type
Definition TensorForwardDeclarations.h:22
Definition TensorContraction.h:294
Definition TensorForwardDeclarations.h:37
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition TensorEvaluator.h:29
Definition TensorForwardDeclarations.h:164
static const bool BlockAccess
Definition TensorForwardDeclarations.h:168
static const TiledEvaluation value
Definition TensorForwardDeclarations.h:172
Definition TensorForwardDeclarations.h:147
static const bool value
Definition TensorForwardDeclarations.h:148
Definition TensorForwardDeclarations.h:40
static const bool val
Definition TensorForwardDeclarations.h:41
Definition TensorForwardDeclarations.h:46
A * type
Definition TensorForwardDeclarations.h:47
Definition ForwardDeclarations.h:17