Reworked the expression evaluation mechanism in order to make it possible to efficiently compute convolutions and contractions in the future:

* The scheduling of computation is moved out the the assignment code and into a new TensorExecutor class
 * The assignment itself is now a regular node on the expression tree
 * The expression evaluators start by recursively evaluating all their subexpressions if needed
This commit is contained in:
Benoit Steiner
2014-06-13 09:56:51 -07:00
parent aa664eabb9
commit 38ab7e6ed0
14 changed files with 695 additions and 174 deletions

View File

@@ -184,6 +184,14 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
buffer[i] += coeff(i);
}
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalSubExprsIfNeeded() {
m_leftImpl.evalSubExprsIfNeeded();
m_rightImpl.evalSubExprsIfNeeded();
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() {
m_leftImpl.cleanup();
m_rightImpl.cleanup();
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
{