Hi PA, hi all,
two remarks while quickly browsing the code:
Paul-Antoine Arras:
+ if (n->sym->ts.type != BT_DERIVED
+ || !n->sym->ts.u.derived->ts.is_iso_c)
+ {
+ gfc_error ("argument list item %qs in "
+ "%<need_device_ptr%> at %L must be of "
+ "TYPE(C_PTR)",
+ n->sym->name, &n->where);
I think you need to rule out 'c_funptr' as well, e.g. via:
|| (n->sym->ts.u.derived->intmod_sym_id
!= ISOCBINDING_PTR)))
I do note that in openmp.cc, we have one check which checks explicitly
for c_ptr and one existing one which only checks for (c_ptr or
c_funptr); can you fix that one as well?
* * *
But I mainly miss an update to 'module.cc' for the 'declare variant'
change; the 'adjust_args' (for 'need_device_ptr', only) list items have
to be saved in the .mod file - otherwise the following will not work:
<some-file>-aux.f90
! { dg-do compile { target skip-all-targets } }
module my_mod
...
!$omp declare variant ... adjust_args(need_device_ptr: ...)
...
end module
<some-file>.f90
{ dg-do ...
! { dg-additional-sources <some-file>-aux.f90 }
...
call <base-function>
...
!$omp displatch
call <base-function>
end
For C++ modules, it should be fine as those for those, the tree is dumped.
Tobias