]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix OpenACC "ephemeral" asynchronous host-to-device copies
authorJulian Brown <julian@codesourcery.com>
Wed, 11 Sep 2019 20:22:03 +0000 (13:22 -0700)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 21 Jun 2022 13:11:21 +0000 (14:11 +0100)
libgomp/
* testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c (main): Fix
async-safety issue. Increase number of iterations.

libgomp/ChangeLog.omp
libgomp/testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c

index 6ac1b743ccf93bf7d377223ad87057d2d46360e4..dc2e8893756469bba2fca6821b1b40f692c6142a 100644 (file)
@@ -1,3 +1,9 @@
+2019-09-17  Julian Brown  <julian@codesourcery.com>
+           Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       * testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c (main): Fix
+       async-safety issue. Increase number of iterations.
+
 2021-04-07  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
        * oacc-mem.c (goacc_enter_data_internal): Unlock mutex before calling
index 573a8214bf0195d96942e4488536ef860a0c6892..dadb6d37942f2c1c38413f7829292dd125395947 100644 (file)
@@ -1,6 +1,8 @@
 #include <stdlib.h>
 
-/* Test asyncronous attach and detach operation.  */
+#define ITERATIONS 1023
+
+/* Test asynchronous attach and detach operation.  */
 
 typedef struct {
   int *a;
@@ -25,13 +27,13 @@ main (int argc, char* argv[])
 
 #pragma acc enter data copyin(m)
 
-  for (int i = 0; i < 99; i++)
+  for (int i = 0; i < ITERATIONS; i++)
     {
       int j;
-#pragma acc parallel loop copy(m.a[0:N]) async(i % 2)
+#pragma acc parallel loop copy(m.a[0:N]) async(0)
       for (j = 0; j < N; j++)
        m.a[j]++;
-#pragma acc parallel loop copy(m.b[0:N]) async((i + 1) % 2)
+#pragma acc parallel loop copy(m.b[0:N]) async(1)
       for (j = 0; j < N; j++)
        m.b[j]++;
     }
@@ -40,9 +42,9 @@ main (int argc, char* argv[])
 
   for (i = 0; i < N; i++)
     {
-      if (m.a[i] != 99)
+      if (m.a[i] != ITERATIONS)
        abort ();
-      if (m.b[i] != 99)
+      if (m.b[i] != ITERATIONS)
        abort ();
     }