10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_LAYOUT_SWAP_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_LAYOUT_SWAP_H
40 template<
typename XprType>
41 struct traits<TensorLayoutSwapOp<XprType> > :
public traits<XprType>
43 typedef typename XprType::Scalar Scalar;
45 typedef typename XprTraits::StorageKind StorageKind;
46 typedef typename XprTraits::Index
Index;
47 typedef typename XprType::Nested Nested;
48 typedef std::remove_reference_t<Nested> Nested_;
51 typedef typename XprTraits::PointerType PointerType;
54 template<
typename XprType>
55 struct eval<TensorLayoutSwapOp<XprType>,
Eigen::Dense>
57 typedef const TensorLayoutSwapOp<XprType>& type;
60 template<
typename XprType>
61 struct nested<TensorLayoutSwapOp<XprType>, 1, typename eval<TensorLayoutSwapOp<XprType> >::type>
63 typedef TensorLayoutSwapOp<XprType> type;
70 template<
typename XprType>
75 typedef typename Eigen::internal::traits<TensorLayoutSwapOp>::Scalar
Scalar;
78 typedef typename Eigen::internal::nested<TensorLayoutSwapOp>::type
Nested;
79 typedef typename Eigen::internal::traits<TensorLayoutSwapOp>::StorageKind
StorageKind;
80 typedef typename Eigen::internal::traits<TensorLayoutSwapOp>::Index
Index;
96 template<
typename ArgType,
typename Device>
101 static constexpr
int NumDims = internal::array_size<typename TensorEvaluator<ArgType, Device>::Dimensions>::value;
119 : m_impl(op.expression(), device)
121 for(
int i = 0;
i < NumDims; ++
i) {
122 m_dimensions[
i] = m_impl.dimensions()[NumDims-1-
i];
135 return m_impl.evalSubExprsIfNeeded(
data);
143 return m_impl.coeff(index);
146 template<
int LoadMode>
149 return m_impl.template packet<LoadMode>(index);
153 return m_impl.costPerCoeff(vectorized);
169 template<
typename ArgType,
typename Device>
200 return this->m_impl.coeffRef(index);
205 this->m_impl.template writePacket<StoreMode>(index,
x);
#define EIGEN_DEVICE_FUNC
#define EIGEN_TENSOR_INHERIT_ASSIGNMENT_OPERATORS(Derived)
Eigen::internal::traits< TensorLayoutSwapOp >::Scalar Scalar
std::remove_const_t< typename XprType::CoeffReturnType > CoeffReturnType
Eigen::internal::traits< TensorLayoutSwapOp >::StorageKind StorageKind
TensorBase< TensorLayoutSwapOp< XprType >, WriteAccessors > Base
Eigen::internal::nested< TensorLayoutSwapOp >::type Nested
Eigen::NumTraits< Scalar >::Real RealScalar
const internal::remove_all_t< typename XprType::Nested > & expression() const
Eigen::internal::traits< TensorLayoutSwapOp >::Index Index
TensorLayoutSwapOp(const XprType &expr)
typename remove_all< T >::type remove_all_t
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend
T * constCast(const T *data)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
internal::packet_traits< Scalar >::type type
void writePacket(Index index, const PacketReturnType &x) const
internal::TensorBlockNotImplemented TensorBlock
PacketType< CoeffReturnType, Device >::type PacketReturnType
TensorEvaluator(const XprType &op, const Device &device)
TensorLayoutSwapOp< ArgType > XprType
CoeffReturnType & coeffRef(Index index) const
TensorEvaluator< const TensorLayoutSwapOp< ArgType >, Device > Base
XprType::CoeffReturnType CoeffReturnType
const Dimensions & dimensions() const
TensorEvaluator(const XprType &op, const Device &device)
DSizes< Index, NumDims > Dimensions
TensorEvaluator< ArgType, Device > m_impl
internal::TensorBlockNotImplemented TensorBlock
Storage::Type EvaluatorPointerType
TensorOpCost costPerCoeff(bool vectorized) const
XprType::CoeffReturnType CoeffReturnType
bool evalSubExprsIfNeeded(EvaluatorPointerType data)
TensorLayoutSwapOp< ArgType > XprType
PacketType< CoeffReturnType, Device >::type PacketReturnType
const TensorEvaluator< ArgType, Device > & impl() const
StorageMemory< CoeffReturnType, Device > Storage
PacketReturnType packet(Index index) const
CoeffReturnType coeff(Index index) const
Storage::Type data() const
A cost model used to limit the number of threads used for evaluating tensor expression.
static constexpr int Layout
EvaluatorPointerType data() const