10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_FORCED_EVAL_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_FORCED_EVAL_H 29 template<
typename XprType,
template <
class>
class MakePointer_>
33 typedef typename XprType::Scalar
Scalar;
37 typedef typename XprType::Nested
Nested;
39 static const int NumDimensions = XprTraits::NumDimensions;
40 static const int Layout = XprTraits::Layout;
52 template<
typename XprType,
template <
class>
class MakePointer_>
58 template<
typename XprType,
template <
class>
class MakePointer_>
68 template<
typename XprType,
template <
class>
class MakePointer_>
91 template<
typename ArgType,
typename Device,
template <
class>
class MakePointer_>
95 typedef typename ArgType::Scalar
Scalar;
104 PacketAccess = (PacketSize > 1),
111 : m_impl(op.expression(), device), m_op(op.expression()), m_device(device), m_buffer(NULL)
114 EIGEN_DEVICE_FUNC
const Dimensions&
dimensions()
const {
return m_impl.dimensions(); }
118 m_buffer = (CoeffReturnType*)m_device.allocate(numValues *
sizeof(CoeffReturnType));
121 for (Index i = 0; i < numValues; ++i) {
122 new(m_buffer+i) CoeffReturnType();
126 EvalTo evalToTmp(m_buffer, m_op);
132 m_device.deallocate(m_buffer);
138 return m_buffer[index];
141 template<
int LoadMode>
144 return internal::ploadt<PacketReturnType, LoadMode>(m_buffer + index);
148 return TensorOpCost(
sizeof(CoeffReturnType), 0, 0, vectorized, PacketSize);
156 const Device&
device()
const{
return m_device;}
167 #endif // EIGEN_CXX11_TENSOR_TENSOR_FORCED_EVAL_H Eigen::internal::nested< TensorForcedEvalOp >::type Nested
const TensorEvaluator< ArgType, Device > & impl()
required by sycl in order to extract the sycl accessor
const TensorForcedEvalOp< XprType, MakePointer_ > & type
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t array_prod(const Sizes< Indices... > &)
#define EIGEN_STRONG_INLINE
Eigen::internal::traits< TensorForcedEvalOp >::Index Index
EIGEN_DEVICE_FUNC const Dimensions & dimensions() const
TensorEvaluator< ArgType, Device > m_impl
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const
XprType::CoeffReturnType CoeffReturnType
TensorEvaluator< ArgType, Device >::Dimensions Dimensions
A cost model used to limit the number of threads used for evaluating tensor expression.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
TensorForcedEvalOp< ArgType, MakePointer_ > XprType
internal::remove_const< typename XprType::CoeffReturnType >::type CoeffReturnType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const
remove_reference< Nested >::type _Nested
EIGEN_DEVICE_FUNC TensorEvaluator(const XprType &op, const Device &device)
op_ is used for sycl
traits< XprType > XprTraits
EIGEN_DEVICE_FUNC MakePointer< Scalar >::Type data() const
Eigen::internal::traits< TensorForcedEvalOp >::StorageKind StorageKind
Eigen::internal::traits< TensorForcedEvalOp >::Scalar Scalar
PacketType< CoeffReturnType, Device >::type PacketReturnType
Eigen::NumTraits< Scalar >::Real RealScalar
MakePointer_< T > MakePointerT
MakePointer< CoeffReturnType >::Type m_buffer
const Device & device() const
used by sycl in order to build the sycl buffer
traits< XprType >::StorageKind StorageKind
void run(Expr &expr, Dev &dev)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(CoeffReturnType *)
EIGEN_DEVICE_FUNC const internal::remove_all< typename XprType::Nested >::type & expression() const
internal::packet_traits< Scalar >::type type
traits< XprType >::Index Index
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorForcedEvalOp(const XprType &expr)
TensorForcedEvalOp< XprType, MakePointer_ > type