mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
TensorEval are now typed on the device: this will make it possible to use partial template specialization to optimize the strategy of each evaluator for each device type.
Started work on partial evaluations.
This commit is contained in:
@@ -198,19 +198,25 @@ class TensorBase<Derived, ReadOnlyAccessors>
|
||||
}
|
||||
|
||||
// Coefficient-wise ternary operators.
|
||||
template<typename ThenDerived, typename ElseDerived>
|
||||
inline const TensorSelectOp<const Derived, const ThenDerived, const ElseDerived>
|
||||
template<typename ThenDerived, typename ElseDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
const TensorSelectOp<const Derived, const ThenDerived, const ElseDerived>
|
||||
select(const ThenDerived& thenTensor, const ElseDerived& elseTensor) const {
|
||||
return TensorSelectOp<const Derived, const ThenDerived, const ElseDerived>(derived(), thenTensor.derived(), elseTensor.derived());
|
||||
}
|
||||
|
||||
// Morphing operators (slicing tbd).
|
||||
template <typename NewDimensions>
|
||||
inline const TensorReshapingOp<const Derived, const NewDimensions>
|
||||
template <typename NewDimensions> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
const TensorReshapingOp<const Derived, const NewDimensions>
|
||||
reshape(const NewDimensions& newDimensions) const {
|
||||
return TensorReshapingOp<const Derived, const NewDimensions>(derived(), newDimensions);
|
||||
}
|
||||
|
||||
// Force the evaluation of the expression.
|
||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
const TensorForcedEvalOp<const Derived> eval() const {
|
||||
return TensorForcedEvalOp<const Derived>(derived());
|
||||
}
|
||||
|
||||
protected:
|
||||
template <typename OtherDerived, int AccessLevel> friend class TensorBase;
|
||||
EIGEN_DEVICE_FUNC
|
||||
|
||||
Reference in New Issue
Block a user