Add async evaluation support to TensorSlicingOp.

Device::memcpy is not async-safe and might lead to deadlocks. Always evaluate slice expression in async mode.
This commit is contained in:
Eugene Zhulenev 2020-04-22 19:55:01 +00:00
parent 0c67b855d2
commit 3c02fefec5

View File

@ -559,6 +559,14 @@ struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Devi
}
return true;
}
#ifdef EIGEN_USE_THREADS
template <typename EvalSubExprsCallback>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void evalSubExprsIfNeededAsync(
EvaluatorPointerType data, EvalSubExprsCallback done) {
m_impl.evalSubExprsIfNeededAsync(nullptr, [done](bool) { done(true); });
}
#endif // EIGEN_USE_THREADS
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() {
m_impl.cleanup();