[Openmp-commits] [openmp] [Libomptarget] Fix Nvidia offloading hanging on dataRetrieve using RPC (PR #66817)

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Sat Sep 23 07:50:20 PDT 2023


================
@@ -0,0 +1,22 @@
+// RUN: %libomptarget-compile-run-and-check-generic
+
+// REQUIRES: libc
+
+#include <assert.h>
+#include <stdio.h>
+
+#pragma omp declare target to(stdout)
+
+int main() {
+  int r = 0;
+// CHECK: PASS
+#pragma omp target map(from : r)
+  { r = fwrite("PASS\n", 1, sizeof("PASS\n") - 1, stdout); }
+  assert(r == sizeof("PASS\n") - 1 && "Incorrect number of bytes written");
----------------
jdoerfert wrote:

Could you explain what thread/action uses which stream here?
I'm not 100% sure the extra sync above is sufficient (e.g., what about H2D?) and necessary.
Maybe we should just have more streams involved, but I am not clear what streams we currently use (for the RPC parts).

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


More information about the Openmp-commits mailing list