diff options
author | Julian Brown <julian@codesourcery.com> | 2019-05-28 08:42:10 -0700 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2020-03-03 12:18:27 +0100 |
commit | a7649ea738ea7f6c3ac367377c08ef1c2832d495 (patch) | |
tree | cc25b710b2332330a552c9448cdac79a0c5fd9ea /libgomp | |
parent | 3a401f9ba1040a7a3bc6fe2c5acbcec6c2620748 (diff) | |
download | gcc-a7649ea738ea7f6c3ac367377c08ef1c2832d495.zip gcc-a7649ea738ea7f6c3ac367377c08ef1c2832d495.tar.gz gcc-a7649ea738ea7f6c3ac367377c08ef1c2832d495.tar.bz2 |
Apply gangprivate attribute to innermost decl
...and fix parallelism-level calculation when applying the attribute.
gcc/
* omp-low.c (mark_oacc_gangprivate): Add CTX parameter. Use to look up
correct decl to add attribute to.
(lower_omp_for): Move "oacc gangprivate" processing from here...
(process_oacc_gangprivate_1): ...to here. New function.
(lower_omp_target): Update call to mark_oacc_gangprivate.
(execute_lower_omp): Call process_oacc_gangprivate_1 for each OMP
context.
libgomp/
* testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90: New test.
(cherry picked from openacc-gcc-9-branch commit
ac8b85410f6d8b0c02f130527713da488f243d57)
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog.omp | 4 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90 | 23 |
2 files changed, 27 insertions, 0 deletions
diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp index 8f9cd61..b3bcb31 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,7 @@ +2019-05-28 Julian Brown <julian@codesourcery.com> + + * testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90: New test. + 2019-01-30 Andrew Jenner <andrew@codesourcery.com> * testsuite/libgomp.fortan/fortran.exp (lang_link_flags): Add diff --git a/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90 new file mode 100644 index 0000000..d147229 --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90 @@ -0,0 +1,23 @@ +! Test for lack of "oacc gangprivate" attribute on worker-private variables + +! { dg-do run } +! { dg-additional-options "-fdump-tree-omplower-details" } +! { dg-final { scan-tree-dump-times "Setting 'oacc gangprivate' attribute for decl" 0 "omplower" } } */ + +program main + integer :: w, arr(0:31) + + !$acc parallel num_gangs(32) num_workers(32) copyout(arr) + !$acc loop gang worker private(w) + do j = 0, 31 + w = 0 + !$acc loop seq + do i = 0, 31 + w = w + 1 + end do + arr(j) = w + end do + !$acc end parallel + + if (any (arr .ne. 32)) stop 1 +end program main |