Fortran - fix OpenMP 'target simd'
gcc/fortran/ * parse.c (parse_executable): Add missing ST_OMP_TARGET_SIMD. libgomp/ * testsuite/libgomp.fortran/target-simd.f90: New. From-SVN: r276698
This commit is contained in:
parent
07f37a7fd4
commit
65b67cf390
4 changed files with 35 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
2019-10-08 Tobias Burnus <tobias@codesourcery.com>
|
||||
|
||||
* parse.c (parse_executable): Add missing ST_OMP_TARGET_SIMD.
|
||||
|
||||
2019-10-08 Tobias Burnus <tobias@codesourcery.com>
|
||||
|
||||
* match.h (gfc_match_omp_eos_error): Renamed from gfc_match_omp_eos.
|
||||
|
|
|
@ -5534,6 +5534,7 @@ parse_executable (gfc_statement st)
|
|||
case ST_OMP_SIMD:
|
||||
case ST_OMP_TARGET_PARALLEL_DO:
|
||||
case ST_OMP_TARGET_PARALLEL_DO_SIMD:
|
||||
case ST_OMP_TARGET_SIMD:
|
||||
case ST_OMP_TARGET_TEAMS_DISTRIBUTE:
|
||||
case ST_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO:
|
||||
case ST_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD:
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2019-10-08 Tobias Burnus <tobias@codesourcery.com>
|
||||
|
||||
* gfortran.dg/gomp/target-simd.f90: New.
|
||||
|
||||
2019-10-02 Julian Brown <julian@codesourcery.com>
|
||||
Cesar Philippidis <cesar@codesourcery.com>
|
||||
|
||||
|
|
26
libgomp/testsuite/libgomp.fortran/target-simd.f90
Normal file
26
libgomp/testsuite/libgomp.fortran/target-simd.f90
Normal file
|
@ -0,0 +1,26 @@
|
|||
! { dg-do run }
|
||||
|
||||
program test
|
||||
implicit none
|
||||
real, allocatable :: a(:), b(:)
|
||||
integer :: i
|
||||
|
||||
a = [(i, i = 1, 100)]
|
||||
allocate(b, mold=a)
|
||||
b = 0
|
||||
|
||||
!$omp target simd map(to:a) map(from:b)
|
||||
do i = 0, size(a)
|
||||
b(i) = 5.0 * a(i)
|
||||
end do
|
||||
|
||||
if (any (b - 5.0 *a > 10.0*epsilon(a))) call abort()
|
||||
|
||||
!$omp target simd map(to:a) map(from:b)
|
||||
do i = 0, size(a)
|
||||
b(i) = 2.0 * a(i)
|
||||
end do
|
||||
!$omp end target simd
|
||||
|
||||
if (any (b - 2.0 *a > 10.0*epsilon(a))) call abort()
|
||||
end program test
|
Loading…
Add table
Reference in a new issue