bbb7f8604e
This patch adds the 'has_device_addr' clause to the OpenMP 'target' construct which was introduced in OpenMP 5.1 (OpenMP API 5.1 specification pp. 197ff): has_device_addr(list) "The has_device_addr clause indicates that its list items already have device addresses and therefore they may be directly accessed from a target device. If the device address of a list item is not for the device on which the target region executes, accessing the list item inside the region results in unspecified behavior. The list items may include array sections." (p. 200) "A list item may not be specified in both an is_device_ptr clause and a has_device_addr clause on the directive." (p. 202) "A list item that appears in an is_device_ptr or a has_device_addr clause must not be specified in any data-sharing attribute clause on the same target construct." (p. 203) gcc/c-family/ChangeLog: * c-omp.cc (c_omp_split_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR case. * c-pragma.h (enum pragma_kind): Added 5.1 in comment. (enum pragma_omp_clause): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR. gcc/c/ChangeLog: * c-parser.cc (c_parser_omp_clause_name): Parse 'has_device_addr' clause. (c_parser_omp_variable_list): Handle array sections. (c_parser_omp_clause_has_device_addr): Added. (c_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR case. (c_parser_omp_target_exit_data): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK. * c-typeck.cc (handle_omp_array_sections): Handle clause restrictions. (c_finish_omp_clauses): Handle array sections. gcc/cp/ChangeLog: * parser.cc (cp_parser_omp_clause_name): Parse 'has_device_addr' clause. (cp_parser_omp_var_list_no_open): Handle array sections. (cp_parser_omp_all_clauses): Added PRAGMA_OMP_CLAUSE_HAS_DEVICE_ADDR case. (cp_parser_omp_target_update): Added HAS_DEVICE_ADDR to OMP_CLAUSE_MASK. * semantics.cc (handle_omp_array_sections): Handle clause restrictions. (finish_omp_clauses): Handle array sections. gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_clauses): Added OMP_LIST_HAS_DEVICE_ADDR case. * gfortran.h: Added OMP_LIST_HAS_DEVICE_ADDR. * openmp.cc (enum omp_mask2): Added OMP_CLAUSE_HAS_DEVICE_ADDR. (gfc_match_omp_clauses): Parse HAS_DEVICE_ADDR clause. (resolve_omp_clauses): Same. * trans-openmp.cc (gfc_trans_omp_variable_list): Added OMP_LIST_HAS_DEVICE_ADDR case. (gfc_trans_omp_clauses): Firstprivatize of array descriptors. gcc/ChangeLog: * gimplify.cc (gimplify_scan_omp_clauses): Added cases for OMP_CLAUSE_HAS_DEVICE_ADDR and handle array sections. (gimplify_adjust_omp_clauses): Added OMP_CLAUSE_HAS_DEVICE_ADDR case. * omp-low.cc (scan_sharing_clauses): Handle OMP_CLAUSE_HAS_DEVICE_ADDR. (lower_omp_target): Same. * tree-core.h (enum omp_clause_code): Same. * tree-nested.cc (convert_nonlocal_omp_clauses): Same. (convert_local_omp_clauses): Same. * tree-pretty-print.cc (dump_omp_clause): Same. * tree.cc: Same. libgomp/ChangeLog: * libgomp.texi: Updated entry for HAS_DEVICE_ADDR. * target.c (copy_firstprivate_data): Copy only if host address is not NULL. * testsuite/libgomp.c++/target-has-device-addr-2.C: New test. * testsuite/libgomp.c++/target-has-device-addr-4.C: New test. * testsuite/libgomp.c++/target-has-device-addr-5.C: New test. * testsuite/libgomp.c++/target-has-device-addr-6.C: New test. * testsuite/libgomp.c-c++-common/target-has-device-addr-1.c: New test. * testsuite/libgomp.c/target-has-device-addr-3.c: New test. * testsuite/libgomp.fortran/target-has-device-addr-1.f90: New test. * testsuite/libgomp.fortran/target-has-device-addr-2.f90: New test. * testsuite/libgomp.fortran/target-has-device-addr-3.f90: New test. * testsuite/libgomp.fortran/target-has-device-addr-4.f90: New test. gcc/testsuite/ChangeLog: * c-c++-common/gomp/clauses-1.c: Added has_device_addr to test cases. * g++.dg/gomp/attrs-1.C: Added has_device_addr to test cases. * g++.dg/gomp/attrs-2.C: Added has_device_addr to test cases. * c-c++-common/gomp/target-has-device-addr-1.c: New test. * c-c++-common/gomp/target-has-device-addr-2.c: New test. * c-c++-common/gomp/target-is-device-ptr-1.c: New test. * c-c++-common/gomp/target-is-device-ptr-2.c: New test. * gfortran.dg/gomp/is_device_ptr-3.f90: New test. * gfortran.dg/gomp/target-has-device-addr-1.f90: New test. * gfortran.dg/gomp/target-has-device-addr-2.f90: New test. |
||
---|---|---|
.. | ||
appendix-a | ||
examples-4 | ||
address-space-1.c | ||
affinity-1.c | ||
affinity-2.c | ||
atomic-1.c | ||
atomic-2.c | ||
atomic-3.c | ||
atomic-4.c | ||
atomic-5.c | ||
atomic-6.c | ||
atomic-10.c | ||
atomic-11.c | ||
atomic-12.c | ||
atomic-13.c | ||
atomic-14.c | ||
atomic-15.c | ||
atomic-16.c | ||
atomic-17.c | ||
autopar-1.c | ||
autopar-2.c | ||
autopar-3.c | ||
autopar-4.c | ||
autopar-5.c | ||
autopar-6.c | ||
autopar-7.c | ||
autopar-8.c | ||
barrier-1.c | ||
c.exp | ||
cancel-for-1.c | ||
cancel-for-2.c | ||
cancel-parallel-1.c | ||
cancel-parallel-2.c | ||
cancel-parallel-3.c | ||
cancel-sections-1.c | ||
collapse-1.c | ||
collapse-2.c | ||
collapse-3.c | ||
copyin-1.c | ||
copyin-2.c | ||
copyin-3.c | ||
critical-1.c | ||
critical-2.c | ||
debug-1.c | ||
declare-variant-1.c | ||
declare-variant-2.c | ||
depend-1.c | ||
depend-2.c | ||
depend-3.c | ||
depend-4.c | ||
depend-5.c | ||
depend-6.c | ||
depend-7.c | ||
depend-8.c | ||
depend-9.c | ||
depend-10.c | ||
doacross-1.c | ||
doacross-2.c | ||
doacross-3.c | ||
icv-1.c | ||
icv-2.c | ||
lib-1.c | ||
lib-2.c | ||
linear-1.c | ||
lock-1.c | ||
lock-2.c | ||
lock-3.c | ||
loop-1.c | ||
loop-2.c | ||
loop-3.c | ||
loop-4.c | ||
loop-5.c | ||
loop-6.c | ||
loop-7.c | ||
loop-8.c | ||
loop-9.c | ||
loop-10.c | ||
loop-11.c | ||
loop-12.c | ||
loop-16.c | ||
loop-17.c | ||
loop-18.c | ||
loop-19.c | ||
loop-20.c | ||
loop-21.c | ||
loop-22.c | ||
loop-23.c | ||
loop-24.c | ||
loop-25.c | ||
loop-26.c | ||
loop-27.c | ||
nested-1.c | ||
nested-2.c | ||
nested-3.c | ||
nestedfn-1.c | ||
nestedfn-2.c | ||
nestedfn-3.c | ||
nestedfn-4.c | ||
nestedfn-5.c | ||
nestedfn-6.c | ||
nqueens-1.c | ||
omp_hello.c | ||
omp_matvec.c | ||
omp_orphan.c | ||
omp_reduction.c | ||
omp_workshare1.c | ||
omp_workshare2.c | ||
omp_workshare3.c | ||
omp_workshare4.c | ||
omp-loop01.c | ||
omp-loop02.c | ||
omp-loop03.c | ||
omp-nested-1.c | ||
omp-nested-2.c | ||
omp-nested-3.c | ||
omp-parallel-for.c | ||
omp-parallel-if.c | ||
omp-single-1.c | ||
omp-single-2.c | ||
omp-single-3.c | ||
ordered-1.c | ||
ordered-2.c | ||
ordered-3.c | ||
ordered-5.c | ||
parallel-1.c | ||
parloops-exit-first-loop-alt-2.c | ||
parloops-exit-first-loop-alt-3.c | ||
parloops-exit-first-loop-alt-4.c | ||
parloops-exit-first-loop-alt-5.c | ||
parloops-exit-first-loop-alt-6.c | ||
parloops-exit-first-loop-alt-7.c | ||
parloops-exit-first-loop-alt.c | ||
places-1.c | ||
places-2.c | ||
places-3.c | ||
places-4.c | ||
places-5.c | ||
places-6.c | ||
places-7.c | ||
places-8.c | ||
places-9.c | ||
places-10.c | ||
pr24455-1.c | ||
pr24455.c | ||
pr26171.c | ||
pr26943-1.c | ||
pr26943-2.c | ||
pr26943-3.c | ||
pr26943-4.c | ||
pr29947-1.c | ||
pr29947-2.c | ||
pr30494.c | ||
pr32362-1.c | ||
pr32362-2.c | ||
pr32362-3.c | ||
pr32468.c | ||
pr33880.c | ||
pr34513.c | ||
pr35130.c | ||
pr35196.c | ||
pr35549.c | ||
pr35625.c | ||
pr36802-1.c | ||
pr36802-2.c | ||
pr36802-3.c | ||
pr38650.c | ||
pr39154.c | ||
pr39591-1.c | ||
pr39591-2.c | ||
pr39591-3.c | ||
pr42029.c | ||
pr42942.c | ||
pr43893.c | ||
pr46032-2.c | ||
pr46032.c | ||
pr46193.c | ||
pr46886.c | ||
pr48591.c | ||
pr49897-1.c | ||
pr49897-2.c | ||
pr49898-1.c | ||
pr49898-2.c | ||
pr52547.c | ||
pr58392.c | ||
pr58756.c | ||
pr61200.c | ||
pr64734.c | ||
pr66133.c | ||
pr66714.c | ||
pr68960.c | ||
pr69110.c | ||
pr69805.c | ||
pr70680-1.c | ||
pr70680-2.c | ||
pr79940.c | ||
pr80394.c | ||
pr80809-1.c | ||
pr80809-2.c | ||
pr80809-3.c | ||
pr80853.c | ||
pr81687-1.c | ||
pr81687-2.c | ||
pr81778.c | ||
pr86416-1.c | ||
pr86416-2.c | ||
pr86660.c | ||
pr89002.c | ||
pr90779.c | ||
pr90811.c | ||
pr93566.c | ||
pr95620.c | ||
pr99555-1.c | ||
pr104385.c | ||
priority.c | ||
private-1.c | ||
reduction-1.c | ||
reduction-2.c | ||
reduction-3.c | ||
reduction-4.c | ||
reduction-5.c | ||
reduction-6.c | ||
reduction-7.c | ||
reduction-8.c | ||
reduction-9.c | ||
reduction-10.c | ||
reduction-11.c | ||
reduction-12.c | ||
reduction-13.c | ||
reduction-14.c | ||
reduction-15.c | ||
scan-1.c | ||
scan-2.c | ||
scan-3.c | ||
scan-4.c | ||
scan-5.c | ||
scan-6.c | ||
scan-7.c | ||
scan-8.c | ||
scan-9.c | ||
scan-10.c | ||
scan-11.c | ||
scan-12.c | ||
scan-13.c | ||
scan-14.c | ||
scan-15.c | ||
scan-16.c | ||
scan-17.c | ||
scan-18.c | ||
scan-19.c | ||
scan-20.c | ||
scan-21.c | ||
scan-22.c | ||
sections-1.c | ||
sections-2.c | ||
shared-1.c | ||
shared-2.c | ||
shared-3.c | ||
simd-1.c | ||
simd-2.c | ||
simd-3.c | ||
simd-4.c | ||
simd-5.c | ||
simd-6.c | ||
simd-7.c | ||
simd-8.c | ||
simd-9.c | ||
simd-10.c | ||
simd-11.c | ||
simd-12.c | ||
simd-13.c | ||
single-1.c | ||
single-2.c | ||
sort-1.c | ||
static-chunk-size-one.c | ||
switch-conversion-2.c | ||
switch-conversion.c | ||
target-3.c | ||
target-4.c | ||
target-5.c | ||
target-6.c | ||
target-7.c | ||
target-8.c | ||
target-9.c | ||
target-11.c | ||
target-12.c | ||
target-14.c | ||
target-15.c | ||
target-16.c | ||
target-17.c | ||
target-18.c | ||
target-19.c | ||
target-20.c | ||
target-21.c | ||
target-22.c | ||
target-23.c | ||
target-24.c | ||
target-25.c | ||
target-26.c | ||
target-27.c | ||
target-28.c | ||
target-29.c | ||
target-30.c | ||
target-31.c | ||
target-32.c | ||
target-33.c | ||
target-34.c | ||
target-35.c | ||
target-36.c | ||
target-37.c | ||
target-38.c | ||
target-39.c | ||
target-40.c | ||
target-41.c | ||
target-42.c | ||
target-43.c | ||
target-44.c | ||
target-critical-1.c | ||
target-has-device-addr-3.c | ||
target-link-1.c | ||
target-print-1.c | ||
target-teams-1.c | ||
task-1.c | ||
task-2.c | ||
task-3.c | ||
task-4.c | ||
task-5.c | ||
task-6.c | ||
task-reduction-1.c | ||
task-reduction-2.c | ||
task-reduction-3.c | ||
task-reduction-4.c | ||
teams-1.c | ||
teams-2.c | ||
teams-3.c | ||
teams-4.c | ||
teams-5.c | ||
thread-limit-1.c | ||
thread-limit-2.c | ||
thread-limit-3.c | ||
thread-limit-4.c | ||
thread-limit-5.c | ||
udr-2.c | ||
udr-3.c | ||
uns-outer-4.c | ||
usleep.h | ||
vla-1.c |