On Mon, Oct 31, 2022 at 03:46:25PM +0100, Tobias Burnus wrote: > OpenMP/Fortran: 'target update' with strides + DT components > > OpenMP 5.0 permits to use arrays with strides and derived > type components for the list items to the 'from'/'to' clauses > of the 'target update' directive. > > gcc/fortran/ChangeLog: > > * openmp.cc (gfc_match_omp_clauses): Permit derived types. > (resolve_omp_clauses):Accept noncontiguous > arrays.
Formatting. Missing space before Accept and arrays. could fit on the same line. > * trans-openmp.cc (gfc_trans_omp_clauses): Fixes for > derived-type changes; fix size for scalars. > > libgomp/ChangeLog: > > * testsuite/libgomp.fortran/target-11.f90: New test. > * testsuite/libgomp.fortran/target-13.f90: New test. Otherwise LGTM, assuming it actually works correctly. I don't remember support for non-contiguous copying to/from devices being actually added, on the library side we certainly have omp_target_memcpy_rect which under the hood just does multiple copies of the contiguous subparts, but I don't remember something similar done in GOMP_target_update. And I think it is not ok to copy bytes that aren't requested to be copied. Jakub