[PATCH] OpenMP: Enable 'declare mapper' mappers for 'target update' directives

2023-09-06 Thread Julian Brown
This patch enables use of 'declare mapper' for 'target update' directives, for each of C, C++ and Fortran. There are some implementation choices here and some "read-between-the-lines" consequences regarding this functionality, as follows: * It is possible to invoke a mapper which contains clause

[PATCH 5/5] OpenMP: Noncontiguous "target update" for Fortran

2023-09-06 Thread Julian Brown
This patch implements noncontiguous "target update" for Fortran. The existing middle end/runtime bits relating to C and C++ support are reused, with some small adjustments, e.g.: 1. The node used to map the OMP "array descriptor" (from omp-low.cc onwards) now uses the OMP_CLAUSE_SIZE field

[PATCH 4/5] OpenMP: Array shaping operator and strided "target update" for C

2023-09-06 Thread Julian Brown
Following the similar support for C++, here is the C implementation for the OpenMP 5.0 array-shaping operator, and for strided and rectangular updates for "target update". Much of the implementation is shared with the C++ support added by the previous patch. Some details of parsing necessarily di

[PATCH 2/5] OpenMP: Allow complete replacement of clause during map/to/from expansion

2023-09-06 Thread Julian Brown
At present, map/to/from clauses on OpenMP "target" directives may be expanded into several mapping nodes if they describe array sections with pointer or reference bases, or similar. This patch allows the original clause to be replaced during that expansion, mostly by passing the list pointer to th

[PATCH 0/5] OpenMP: Array-shaping operator and strided/rectangular 'target update' support

2023-09-06 Thread Julian Brown
This patch series provides support for the OpenMP 5.0+ array-shaping operator and for strided/rectangular updates for 'target update' directives. Each of C, C++ and Fortran is supported (using existing base language syntax for the last). This series applies on top of the "infrastructure" support

[PATCH 1/5] OpenMP, NVPTX: memcpy[23]D bias correction

2023-09-06 Thread Julian Brown
This patch works around behaviour of the 2D and 3D memcpy operations in the CUDA driver runtime. Particularly in Fortran, the "base pointer" of an array (used for either source or destination of a host/device copy) may lie outside of data that is actually stored on the device. The fix is to make