We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26676cf commit 8ddcfe9Copy full SHA for 8ddcfe9
include/exec/trampoline_scheduler.hpp
@@ -212,7 +212,15 @@ namespace exec {
212
void __trampoline_state<_Operation>::__drain() noexcept {
213
while (__head_ != nullptr) {
214
// pop the head of the list
215
+#if STDEXEC_NVHPC()
216
+ // there appears to be a codegen bug in nvhpc where the optimizer does not see the
217
+ // assign to __head_ that happens in the std::exchange call below, causing it to
218
+ // erroneously optimize away the `if (__head_ != nullptr)` check later on.
219
+ _Operation* __op = __head_;
220
+ __head_ = __head_->__next_;
221
+#else
222
_Operation* __op = std::exchange(__head_, __head_->__next_);
223
+#endif
224
__op->__next_ = nullptr;
225
__op->__prev_ = nullptr;
226
if (__head_ != nullptr) {
0 commit comments