-
- Downloads
OpenMP: C front-end support for dispatch + adjust_args
This patch adds support to the C front-end to parse the `dispatch` construct and the `adjust_args` clause. It also includes some common C/C++ bits for pragmas and attributes. Additional common C/C++ testcases are in a later patch in the series. gcc/c-family/ChangeLog: * c-attribs.cc (c_common_gnu_attributes): Add attribute for adjust_args need_device_ptr. * c-omp.cc (c_omp_directives): Uncomment dispatch. * c-pragma.cc (omp_pragmas): Add dispatch. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_DISPATCH. (enum pragma_omp_clause): Add PRAGMA_OMP_CLAUSE_NOCONTEXT and PRAGMA_OMP_CLAUSE_NOVARIANTS. gcc/c/ChangeLog: * c-parser.cc (c_parser_omp_dispatch): New function. (c_parser_omp_clause_name): Handle nocontext and novariants clauses. (c_parser_omp_clause_novariants): New function. (c_parser_omp_clause_nocontext): Likewise. (c_parser_omp_all_clauses): Handle nocontext and novariants clauses. (c_parser_omp_dispatch_body): New function adapted from c_parser_expr_no_commas. (OMP_DISPATCH_CLAUSE_MASK): Define. (c_parser_omp_dispatch): New function. (c_finish_omp_declare_variant): Parse adjust_args. (c_parser_omp_construct): Handle PRAGMA_OMP_DISPATCH. * c-typeck.cc (c_finish_omp_clauses): Handle OMP_CLAUSE_NOVARIANTS and OMP_CLAUSE_NOCONTEXT. gcc/testsuite/ChangeLog: * gcc.dg/gomp/adjust-args-1.c: New test. * gcc.dg/gomp/dispatch-1.c: New test. * gcc.dg/gomp/dispatch-2.c: New test. * gcc.dg/gomp/dispatch-3.c: New test. * gcc.dg/gomp/dispatch-4.c: New test. * gcc.dg/gomp/dispatch-5.c: New test.
Showing
- gcc/c-family/c-attribs.cc 3 additions, 0 deletionsgcc/c-family/c-attribs.cc
- gcc/c-family/c-omp.cc 2 additions, 2 deletionsgcc/c-family/c-omp.cc
- gcc/c-family/c-pragma.cc 1 addition, 0 deletionsgcc/c-family/c-pragma.cc
- gcc/c-family/c-pragma.h 3 additions, 0 deletionsgcc/c-family/c-pragma.h
- gcc/c/c-parser.cc 432 additions, 55 deletionsgcc/c/c-parser.cc
- gcc/c/c-typeck.cc 2 additions, 0 deletionsgcc/c/c-typeck.cc
- gcc/testsuite/gcc.dg/gomp/adjust-args-1.c 32 additions, 0 deletionsgcc/testsuite/gcc.dg/gomp/adjust-args-1.c
- gcc/testsuite/gcc.dg/gomp/dispatch-1.c 53 additions, 0 deletionsgcc/testsuite/gcc.dg/gomp/dispatch-1.c
- gcc/testsuite/gcc.dg/gomp/dispatch-2.c 30 additions, 0 deletionsgcc/testsuite/gcc.dg/gomp/dispatch-2.c
- gcc/testsuite/gcc.dg/gomp/dispatch-3.c 16 additions, 0 deletionsgcc/testsuite/gcc.dg/gomp/dispatch-3.c
- gcc/testsuite/gcc.dg/gomp/dispatch-4.c 19 additions, 0 deletionsgcc/testsuite/gcc.dg/gomp/dispatch-4.c
- gcc/testsuite/gcc.dg/gomp/dispatch-5.c 21 additions, 0 deletionsgcc/testsuite/gcc.dg/gomp/dispatch-5.c
Loading
Please register or sign in to comment