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

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Mon Sep 25 07:32:19 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");
----------------
jhuber6 wrote:

Yeah, this could be solved by forking a thread for the RPC server to run in the background, but it seemed better to re-use waiting threads we already have. Changing that is another alternative if we wanted to just fork another "hidden" thread.

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


More information about the Openmp-commits mailing list