mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Add async evaluation support to TensorSelectOp
This commit is contained in:
parent
11d6465326
commit
dbb703d44e
@ -890,6 +890,19 @@ struct TensorEvaluator<const TensorSelectOp<IfArgType, ThenArgType, ElseArgType>
|
|||||||
m_elseImpl.evalSubExprsIfNeeded(NULL);
|
m_elseImpl.evalSubExprsIfNeeded(NULL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef EIGEN_USE_THREADS
|
||||||
|
template <typename EvalSubExprsCallback>
|
||||||
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalSubExprsIfNeededAsync(
|
||||||
|
EvaluatorPointerType, EvalSubExprsCallback done) {
|
||||||
|
m_condImpl.evalSubExprsIfNeeded(nullptr, [this, done](bool) {
|
||||||
|
m_thenImpl.evalSubExprsIfNeeded(nullptr, [this, done](bool) {
|
||||||
|
m_elseImpl.evalSubExprsIfNeeded(nullptr, [done](bool) { done(true); });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
#endif // EIGEN_USE_THREADS
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() {
|
||||||
m_condImpl.cleanup();
|
m_condImpl.cleanup();
|
||||||
m_thenImpl.cleanup();
|
m_thenImpl.cleanup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user