mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-12 17:33:15 +08:00
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:
parent
0c67b855d2
commit
3c02fefec5
@ -559,6 +559,14 @@ struct TensorEvaluator<const TensorSlicingOp<StartIndices, Sizes, ArgType>, Devi
|
|||||||
}
|
}
|
||||||
return true;
|
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() {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() {
|
||||||
m_impl.cleanup();
|
m_impl.cleanup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user