[Openmp-commits] [openmp] [libomptarget][nextgen-plugin] Always use a signal to trigger completion of H2D data transfers (PR #83475)

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Thu Mar 14 09:35:31 PDT 2024


================
@@ -1383,22 +1381,17 @@ struct AMDGPUStreamTy {
       if (auto Err = Plugin::check(Status,
                                    "Error in hsa_amd_signal_async_handler: %s"))
         return Err;
-
-      // Let's use now the second output signal.
-      OutputSignal = OutputSignals[1];
-
-      // Consume another stream slot and compute dependencies.
-      std::tie(Curr, InputSignal) = consume(OutputSignal);
     } else {
       // All preceding operations completed, copy the memory synchronously.
       std::memcpy(Inter, Src, CopySize);
 
-      // Return the second signal because it will not be used.
-      OutputSignals[1]->decreaseUseCount();
-      if (auto Err = SignalManager.returnResource(OutputSignals[1]))
-        return Err;
+      // Signal the end of the operation.
+      Slots[Curr].Signal->signal();
     }
 
+    // Consume another stream slot and compute dependencies.
+    std::tie(Curr, InputSignal) = consume(OutputSignals[1]);
----------------
jhuber6 wrote:

No need for `std::tie`, we're on C++17.

https://github.com/llvm/llvm-project/pull/83475


More information about the Openmp-commits mailing list