https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120530

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
> That system has unified shared memory

Indeed, if I compare the host and the device addresses, I see
different values (= mapped) for sptr1, sptr1->ptrset, sptr1->ptrset2 (→ OK)

BUT: sptr1->ptrset[i] and sptr1->ptrset2[i] still have the host value!

Can you confirm that it works with the following patch?
-----------------------------------------
--- a/libgomp/testsuite/libgomp.c/target-map-zero-sized-3.c
+++ b/libgomp/testsuite/libgomp.c/target-map-zero-sized-3.c
@@ -4 +4 @@ main ()
-  int i, n, n2;
+  int i, n;
@@ -36 +36 @@ main ()
-  n2 = 2;
+  #pragma omp target enter data map(data)
@@ -40 +40 @@ main ()
-  #pragma omp target
+  #pragma omp target map(sptr1->ptrset[i][:n], sptr1->ptrset2[i][:n])
@@ -45,0 +46 @@ main ()
+  #pragma omp target exit data map(data)

Reply via email to