[PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args
Tobias Burnus
tburnus@baylibre.com
Tue Dec 17 13:11:36 GMT 2024
Hi all, hello PA,
Tobias Burnus wrote:
> Paul-Antoine Arras wrote:
>> See the revised patch attached and my comments below.
> I have not looked in depth at the patch, but managed to
> write C-ism code, which caused a segfault (due to a missing "call"),
Additional comments: Can you hoist the condition out of the loop in:
> + for (gfc_omp_namelist *n = *head; n != NULL; n = n->next) + if
> (need_device_ptr_p) + n->u.need_device_ptr = true;
* * *
I was about to complain that it didn't handle VALUE + OPTIONAL
correctly, but that's a generic gfortran bug (or two):
->https://gcc.gnu.org/PR118080
* * *
There is a bug - 'nowait' is not propagated. Trying:
!$omp dispatch depend(inout:x) nowait
call g(a)
!$omp end dispatch
gives (-fdump-tree-gimple): #pragma omp taskwait depend(inout:&x) nowait
but doing the equivalent !$omp dispatch depend(inout:x) call g(a) !$omp
end dispatch nowait gives: #pragma omp taskwait depend(inout:&x) i.e.
the 'nowait' got lost. * * *
Similar the original C code, which to my knowledge is now
fixed + tested for, there is an issue related to handling nested
function calls.
I think the attached testcase is fine, but it segfaults unless
the default device is the initial device. The problem is that
the pointer conversion also happens for the inner function but
it should only do so for the outer one.
See attached testcase. – I think it can be seen by looking at the
dump (and adding an -fdump-tree-gimple + scan test probably won't
harm, as not everyone has a GPU and we might implement map as
selfmap on APUs).
Otherwise LGTM.
Tobias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20241217/f40db9ed/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.f90
Type: text/x-fortran
Size: 1676 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20241217/f40db9ed/attachment.bin>
More information about the Fortran
mailing list