-
- Downloads
Add support for device-modifiers for 'omp target device'.
'device_num' and 'ancestor' are now parsed on target device constructs for C, C++, and Fortran (see OpenMP specification 5.0, p. 170). When 'ancestor' is used, then 'sorry, not supported' is output. Moreover, the restrictions for 'ancestor' are implemented (see OpenMP specification 5.0, p. 174f). gcc/c/ChangeLog: * c-parser.c (c_parser_omp_clause_device): Parse device-modifiers 'device_num' and 'ancestor' in 'target device' clauses. gcc/cp/ChangeLog: * parser.c (cp_parser_omp_clause_device): Parse device-modifiers 'device_num' and 'ancestor' in 'target device' clauses. * semantics.c (finish_omp_clauses): Error handling. Constant device ids must evaluate to '1' if 'ancestor' is used. gcc/fortran/ChangeLog: * gfortran.h: Add variable for 'ancestor' in struct gfc_omp_clauses. * openmp.c (gfc_match_omp_clauses): Parse device-modifiers 'device_num' and 'ancestor' in 'target device' clauses. * trans-openmp.c (gfc_trans_omp_clauses): Set OMP_CLAUSE_DEVICE_ANCESTOR. gcc/ChangeLog: * gimplify.c (gimplify_scan_omp_clauses): Error handling. 'ancestor' only allowed on target constructs and only with particular other clauses. * omp-expand.c (expand_omp_target): Output of 'sorry, not supported' if 'ancestor' is used. * omp-low.c (check_omp_nesting_restrictions): Error handling. No nested OpenMP structs when 'ancestor' is used. (scan_omp_1_stmt): No usage of OpenMP runtime routines in a target region when 'ancestor' is used. * tree-pretty-print.c (dump_omp_clause): Append 'ancestor'. * tree.h (OMP_CLAUSE_DEVICE_ANCESTOR): Define macro. gcc/testsuite/ChangeLog: * c-c++-common/gomp/target-device-1.c: New test. * c-c++-common/gomp/target-device-2.c: New test. * c-c++-common/gomp/target-device-ancestor-1.c: New test. * c-c++-common/gomp/target-device-ancestor-2.c: New test. * c-c++-common/gomp/target-device-ancestor-3.c: New test. * c-c++-common/gomp/target-device-ancestor-4.c: New test. * gfortran.dg/gomp/target-device-1.f90: New test. * gfortran.dg/gomp/target-device-2.f90: New test. * gfortran.dg/gomp/target-device-ancestor-1.f90: New test. * gfortran.dg/gomp/target-device-ancestor-2.f90: New test. * gfortran.dg/gomp/target-device-ancestor-3.f90: New test. * gfortran.dg/gomp/target-device-ancestor-4.f90: New test.
Showing
- gcc/c/c-parser.c 67 additions, 17 deletionsgcc/c/c-parser.c
- gcc/cp/parser.c 41 additions, 1 deletiongcc/cp/parser.c
- gcc/cp/semantics.c 9 additions, 0 deletionsgcc/cp/semantics.c
- gcc/fortran/gfortran.h 1 addition, 0 deletionsgcc/fortran/gfortran.h
- gcc/fortran/openmp.c 45 additions, 2 deletionsgcc/fortran/openmp.c
- gcc/fortran/trans-openmp.c 4 additions, 0 deletionsgcc/fortran/trans-openmp.c
- gcc/gimplify.c 32 additions, 0 deletionsgcc/gimplify.c
- gcc/omp-expand.c 2 additions, 0 deletionsgcc/omp-expand.c
- gcc/omp-low.c 21 additions, 0 deletionsgcc/omp-low.c
- gcc/testsuite/c-c++-common/gomp/target-device-1.c 32 additions, 0 deletionsgcc/testsuite/c-c++-common/gomp/target-device-1.c
- gcc/testsuite/c-c++-common/gomp/target-device-2.c 14 additions, 0 deletionsgcc/testsuite/c-c++-common/gomp/target-device-2.c
- gcc/testsuite/c-c++-common/gomp/target-device-ancestor-1.c 13 additions, 0 deletionsgcc/testsuite/c-c++-common/gomp/target-device-ancestor-1.c
- gcc/testsuite/c-c++-common/gomp/target-device-ancestor-2.c 82 additions, 0 deletionsgcc/testsuite/c-c++-common/gomp/target-device-ancestor-2.c
- gcc/testsuite/c-c++-common/gomp/target-device-ancestor-3.c 37 additions, 0 deletionsgcc/testsuite/c-c++-common/gomp/target-device-ancestor-3.c
- gcc/testsuite/c-c++-common/gomp/target-device-ancestor-4.c 17 additions, 0 deletionsgcc/testsuite/c-c++-common/gomp/target-device-ancestor-4.c
- gcc/testsuite/gfortran.dg/gomp/target-device-1.f90 67 additions, 0 deletionsgcc/testsuite/gfortran.dg/gomp/target-device-1.f90
- gcc/testsuite/gfortran.dg/gomp/target-device-2.f90 12 additions, 0 deletionsgcc/testsuite/gfortran.dg/gomp/target-device-2.f90
- gcc/testsuite/gfortran.dg/gomp/target-device-ancestor-1.f90 9 additions, 0 deletionsgcc/testsuite/gfortran.dg/gomp/target-device-ancestor-1.f90
- gcc/testsuite/gfortran.dg/gomp/target-device-ancestor-2.f90 92 additions, 0 deletionsgcc/testsuite/gfortran.dg/gomp/target-device-ancestor-2.f90
- gcc/testsuite/gfortran.dg/gomp/target-device-ancestor-3.f90 33 additions, 0 deletionsgcc/testsuite/gfortran.dg/gomp/target-device-ancestor-3.f90
Loading
Please register or sign in to comment