]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add support for OpenACC routine nohost clause
authorJulian Brown <julian@codesourcery.com>
Thu, 7 Feb 2019 01:46:25 +0000 (17:46 -0800)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 20 Apr 2021 18:49:30 +0000 (11:49 -0700)
commitc59ce21469a565983b5d6d5addcb28b4a9ae4746
treead3f2222afd0b3686230394232fdaff4ccf7c9d2
parentd7904bb2b5d31443b36a16a819574d3f1664a9c9
Add support for OpenACC routine nohost clause

2018-10-02  Thomas Schwinge  <thomas@codesourcery.com>
    Cesar Philippidis  <cesar@codesourcery.com>

gcc/
* tree-core.h (omp_clause_code): Add OMP_CLAUSE_NOHOST.
* tree.c (omp_clause_num_ops, omp_clause_code_name, walk_tree_1):
Update for these.
* tree-pretty-print.c (dump_omp_clause): Handle OMP_CLAUSE_NOHOST.
* gimplify.c (gimplify_scan_omp_clauses)
(gimplify_adjust_omp_clauses): Handle OMP_CLAUSE_NOHOST.
* tree-nested.c (convert_nonlocal_omp_clauses)
(convert_local_omp_clauses): Likewise.
* omp-low.c (scan_sharing_clauses): Likewise.
* omp-offload.c (maybe_discard_oacc_function): New function.
(execute_oacc_device_lower) [!ACCEL_COMPILER]: Handle OpenACC
nohost clauses.

gcc/c-family/
* c-attribs.c (c_common_attribute_table): Set min_len to -1 for
"omp declare target".
* c-pragma.h (pragma_omp_clause): Add PRAGMA_OACC_CLAUSE_NOHST.

gcc/c/
* c-parser.c (c_parser_omp_clause_name): Handle "nohost".
(c_parser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_NOHOST.
(c_parser_oacc_routine, c_finish_oacc_routine): Update.
* c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_NOHOST.

gcc/cp/
* parser.c (cp_parser_omp_clause_name): Handle "nohost".
(cp_parser_oacc_all_clauses): Handle PRAGMA_OACC_CLAUSE_NOHOST,
(cp_parser_oacc_routine, cp_finalize_oacc_routine): Update.
* pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_NOHOST.
* semantics.c (finish_omp_clauses): Handle OMP_CLAUSE_NOHOST.

gcc/fortran/
* gfortran.h (gfc_omp_clauses): Add nohost members.
* openmp.c (omp_mask2): Add OMP_CLAUSE_NOHOST.
(gfc_match_omp_clauses): Handle OMP_CLAUSE_NOHOST.
(gfc_match_oacc_routine): Set oacc_function_nohost when appropriate.
* gfortran.h (symbol_attribute): Add oacc_function_nohost member.
* trans-openmp.c (gfc_add_omp_offload_attributes): Use it to decide
whether to generate an OMP_CLAUSE_NOHOST clause.
(gfc_trans_omp_clauses_1): Unreachable code to generate an
OMP_CLAUSE_NOHOST clause.

gcc/testsuite/
* c-c++-common/goacc/classify-routine.c: Adjust test.
* c-c++-common/goacc/routine-1.c: Likewise.
* c-c++-common/goacc/routine-2.c: Likewise.
* c-c++-common/goacc/routine-nohost-1.c: New test.
* g++.dg/goacc/routine-2.C: Adjust test.
* gfortran.dg/goacc/pr72741.f90: New test.

libgomp/
* testsuite/libgomp.oacc-c-c++-common/routine-3.c: New test.
* testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c: New test.
* testsuite/libgomp.oacc-c-c++-common/routine-bind-nohost-1.c:
Update test.
* testsuite/libgomp.oacc-fortran/routine-6.f90: Likewise.
32 files changed:
gcc/ChangeLog.omp
gcc/c-family/ChangeLog.omp [new file with mode: 0644]
gcc/c-family/c-pragma.h
gcc/c/ChangeLog.omp
gcc/c/c-parser.c
gcc/c/c-typeck.c
gcc/cp/ChangeLog.omp
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/fortran/ChangeLog.omp
gcc/fortran/gfortran.h
gcc/fortran/openmp.c
gcc/fortran/trans-decl.c
gcc/fortran/trans-openmp.c
gcc/gimplify.c
gcc/omp-low.c
gcc/omp-offload.c
gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/goacc/routine-1.c
gcc/testsuite/c-c++-common/goacc/routine-2.c
gcc/testsuite/c-c++-common/goacc/routine-nohost-1.c [new file with mode: 0644]
gcc/testsuite/g++.dg/goacc/routine-2.C
gcc/testsuite/gfortran.dg/goacc/pr72741.f90 [new file with mode: 0644]
gcc/tree-core.h
gcc/tree-nested.c
gcc/tree-pretty-print.c
gcc/tree.c
libgomp/ChangeLog.omp
libgomp/testsuite/libgomp.oacc-c-c++-common/routine-3.c [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c [new file with mode: 0644]
libgomp/testsuite/libgomp.oacc-fortran/routine-6.f90 [new file with mode: 0644]