From: Julian Brown Date: Wed, 11 Sep 2019 20:22:03 +0000 (-0700) Subject: Fix OpenACC "ephemeral" asynchronous host-to-device copies X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85626d15545773fa967378c235ca19ec93efba4a;p=thirdparty%2Fgcc.git Fix OpenACC "ephemeral" asynchronous host-to-device copies libgomp/ * testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c (main): Fix async-safety issue. Increase number of iterations. --- diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp index 6ac1b743ccf9..dc2e88937564 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,9 @@ +2019-09-17 Julian Brown + Kwok Cheung Yeung + + * 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 * oacc-mem.c (goacc_enter_data_internal): Unlock mutex before calling diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c index 573a8214bf01..dadb6d37942f 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/deep-copy-10.c @@ -1,6 +1,8 @@ #include -/* 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 (); }