[Openmp-commits] [openmp] [openmp][flang] Add tests for map clause (PR #70394)

via Openmp-commits openmp-commits at lists.llvm.org
Fri Oct 27 04:59:09 PDT 2023


================
@@ -0,0 +1,29 @@
+! REQUIRES: flang, amdgcn-amd-amdhsa
+! UNSUPPORTED: nvptx64-nvidia-cuda
+! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
+! UNSUPPORTED: aarch64-unknown-linux-gnu
+! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
+! UNSUPPORTED: x86_64-pc-linux-gnu
+! UNSUPPORTED: x86_64-pc-linux-gnu-LTO
+
+! RUN: %libomptarget-compile-fortran-run-and-check-generic
+! XFAIL: *
+
+program main
+  use omp_lib
+  integer :: devices(2), var1
+  common var1
+  var1 = 10
+  print *, "var1 before target = ", var1
+  devices(1) = omp_get_device_num()
+  !$omp target map(tofrom:devices) map(tofrom:var1)
+    var1 = 20
+    devices(2) = omp_get_device_num()
----------------
agozillon wrote:

awesome to see this working! :D admittedly have never tried it

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


More information about the Openmp-commits mailing list