Loading...
Searching...
No Matches
TensorForwardDeclarations.h
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 adress 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};
24
25template<typename PlainObjectType, int Options_ = Unaligned, template <class> class MakePointer_ = MakePointer> class TensorMap;
26template<typename Scalar_, int NumIndices_, int Options_ = 0, typename IndexType = DenseIndex> class Tensor;
27template<typename Scalar_, typename Dimensions, int Options_ = 0, typename IndexType = DenseIndex> class TensorFixedSize;
28template<typename PlainObjectType> class TensorRef;
29template<typename Derived, int AccessLevel> class TensorBase;
30
31template<typename NullaryOp, typename PlainObjectType> class TensorCwiseNullaryOp;
32template<typename UnaryOp, typename XprType> class TensorCwiseUnaryOp;
33template<typename BinaryOp, typename LeftXprType, typename RightXprType> class TensorCwiseBinaryOp;
34template<typename TernaryOp, typename Arg1XprType, typename Arg2XprType, typename Arg3XprType> class TensorCwiseTernaryOp;
35template<typename IfXprType, typename ThenXprType, typename ElseXprType> class TensorSelectOp;
36template<typename Op, typename Dims, typename XprType, template <class> class MakePointer_ = MakePointer > class TensorReductionOp;
37template<typename XprType> class TensorIndexTupleOp;
38template<typename ReduceOp, typename Dims, typename XprType> class TensorTupleReducerOp;
39template<typename Axis, typename LeftXprType, typename RightXprType> class TensorConcatenationOp;
40template<typename Dimensions, typename LeftXprType, typename RightXprType> class TensorContractionOp;
41template<typename TargetType, typename XprType> class TensorConversionOp;
42template<typename Dimensions, typename InputXprType, typename KernelXprType> class TensorConvolutionOp;
43template<typename FFT, typename XprType, int FFTDataType, int FFTDirection> class TensorFFTOp;
44template<typename PatchDim, typename XprType> class TensorPatchOp;
45template<DenseIndex Rows, DenseIndex Cols, typename XprType> class TensorImagePatchOp;
46template<DenseIndex Planes, DenseIndex Rows, DenseIndex Cols, typename XprType> class TensorVolumePatchOp;
47template<typename Broadcast, typename XprType> class TensorBroadcastingOp;
48template<DenseIndex DimId, typename XprType> class TensorChippingOp;
49template<typename NewDimensions, typename XprType> class TensorReshapingOp;
50template<typename XprType> class TensorLayoutSwapOp;
51template<typename StartIndices, typename Sizes, typename XprType> class TensorSlicingOp;
52template<typename ReverseDimensions, typename XprType> class TensorReverseOp;
53template<typename PaddingDimensions, typename XprType> class TensorPaddingOp;
54template<typename Shuffle, typename XprType> class TensorShufflingOp;
55template<typename Strides, typename XprType> class TensorStridingOp;
56template<typename StartIndices, typename StopIndices, typename Strides, typename XprType> class TensorStridingSlicingOp;
57template<typename Strides, typename XprType> class TensorInflationOp;
58template<typename Generator, typename XprType> class TensorGeneratorOp;
59template<typename LeftXprType, typename RightXprType> class TensorAssignOp;
60template<typename Op, typename XprType> class TensorScanOp;
61
62template<typename CustomUnaryFunc, typename XprType> class TensorCustomUnaryOp;
63template<typename CustomBinaryFunc, typename LhsXprType, typename RhsXprType> class TensorCustomBinaryOp;
64
65template<typename XprType, template <class> class MakePointer_ = MakePointer> class TensorEvalToOp;
66template<typename XprType, template <class> class MakePointer_ = MakePointer> class TensorForcedEvalOp;
67
68template<typename ExpressionType, typename DeviceType> class TensorDevice;
69template<typename Derived, typename Device> struct TensorEvaluator;
70
71struct DefaultDevice;
72struct ThreadPoolDevice;
73struct GpuDevice;
74struct SyclDevice;
75
76enum FFTResultType {
77 RealPart = 0,
78 ImagPart = 1,
79 BothParts = 2
80};
81
82enum FFTDirection {
83 FFT_FORWARD = 0,
84 FFT_REVERSE = 1
85};
86
87
88namespace internal {
89
90template <typename Device, typename Expression>
91struct IsVectorizable {
92 static const bool value = TensorEvaluator<Expression, Device>::PacketAccess;
93};
94
95template <typename Expression>
96struct IsVectorizable<GpuDevice, Expression> {
97 static const bool value = TensorEvaluator<Expression, GpuDevice>::PacketAccess &&
98 TensorEvaluator<Expression, GpuDevice>::IsAligned;
99};
100
101template <typename Expression, typename Device,
102 bool Vectorizable = IsVectorizable<Device, Expression>::value>
103class TensorExecutor;
104
105} // end namespace internal
106
107} // end namespace Eigen
108
109#endif // EIGEN_CXX11_TENSOR_TENSOR_FORWARD_DECLARATIONS_H
Definition TensorAssign.h:56
The tensor base class.
Definition TensorForwardDeclarations.h:29
Definition TensorBroadcasting.h:62
Definition TensorChipping.h:72
Tensor concatenation class.
Definition TensorConcatenation.h:55
Tensor contraction class.
Definition TensorContraction.h:75
Tensor conversion class. This class makes it possible to vectorize type casting operations when the n...
Definition TensorConversion.h:146
Definition TensorConvolution.h:252
Tensor custom class.
Definition TensorCustomOp.h:199
Tensor custom class.
Definition TensorCustomOp.h:49
Tensor binary expression.
Definition TensorExpr.h:189
Tensor nullary expression.
Definition TensorExpr.h:43
Tensor unary expression.
Definition TensorExpr.h:107
Pseudo expression providing an operator = that will evaluate its argument on the specified computing ...
Definition TensorDevice.h:27
The fixed sized version of the tensor class.
Definition TensorFixedSize.h:26
Tensor reshaping class.
Definition TensorForcedEval.h:73
Tensor generator class.
Definition TensorGenerator.h:49
Patch extraction specialized for image processing. This assumes that the input has a least 3 dimensio...
Definition TensorImagePatch.h:58
Tensor inflation class.
Definition TensorInflation.h:49
A tensor expression mapping an existing array of data.
Definition TensorMap.h:30
Tensor padding class. At the moment only padding with a constant value is supported.
Definition TensorPadding.h:51
Tensor patch class.
Definition TensorPatch.h:49
Tensor reduction class.
Definition TensorReduction.h:348
A reference to a tensor expression The expression will be evaluated lazily (as much as possible).
Definition TensorRef.h:120
Tensor reshaping class.
Definition TensorMorphing.h:50
Tensor reverse elements class.
Definition TensorReverse.h:53
Tensor scan class.
Definition TensorScan.h:50
Tensor shuffling class.
Definition TensorShuffling.h:49
Tensor striding class.
Definition TensorStriding.h:49
Patch extraction specialized for processing of volumetric data. This assumes that the input has a lea...
Definition TensorVolumePatch.h:53
The tensor class.
Definition Tensor.h:64
The tensor executor class.
Definition TensorExecutor.h:28
Namespace containing all symbols from the Eigen library.
The tensor evaluator class.
Definition TensorEvaluator.h:27