[Patch] Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]

2022-09-30 Thread Tobias Burnus
While has_device_addr has been implemented (in GCC 12), updating use_device_ptr for Fortran was missed. This patch fixes it: Removing the restrictions and mapping to has_device_addr where applicable. For use_device_ptr something similar was done, albeit I think this has no semantic effect. And

Re: [Patch] Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]

2022-09-30 Thread Tobias Burnus
On 30.09.22 12:41, Tobias Burnus wrote: Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318] The following two lines slipped in – which I have now removed in my version of the patch: --- a/gcc/testsuite/gfortran.dg/gomp/is_device_ptr-1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/is_device_ptr

Re: [Patch] Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]

2022-09-30 Thread Jakub Jelinek via Fortran
On Fri, Sep 30, 2022 at 12:41:19PM +0200, Tobias Burnus wrote: > While has_device_addr has been implemented (in GCC 12), updating > use_device_ptr for Fortran was missed. > > This patch fixes it: Removing the restrictions and mapping to > has_device_addr where applicable. > > For use_device_ptr s

Re: [Patch] Fortran: Update use_device_ptr for OpenMP 5.1 [PR105318]

2022-09-30 Thread Tobias Burnus
Hi Jakub, On 30.09.22 13:04, Jakub Jelinek via Fortran wrote: On Fri, Sep 30, 2022 at 12:41:19PM +0200, Tobias Burnus wrote: And 'device(omp_initial_device)' printed a warning in Fortran. (BTW: C/C++ silently accepts any negative value.) I think that is what the standard wants. E.g. in 5.2 d

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-30 Thread Julian Brown
On Fri, 23 Sep 2022 14:10:51 +0200 Tobias Burnus wrote: > Hi Julian and Jakub, hi all, > > On 23.09.22 09:29, Julian Brown wrote: > > How about this version? (Re-tested.) > > Some more generic (pre)remarks – not affecting the patch code, > but possibly the commit log message: > > > This foll

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-30 Thread Tobias Burnus
Hi Julian, On 30.09.22 15:30, Julian Brown wrote: i = 1; j = 2 map (foo(i)%dt_ptr(1:3), foo(j)%dt_ptr) Good catch! In that gfc_dep_resolver considers those terms to have a dependency, and that triggers the mapping node transformation. But I don't think OpenMP allows you to write this: IIUC

Re: [PATCH v3 06/11] OpenMP: Pointers and member mappings

2022-09-30 Thread Tobias Burnus
On 30.09.22 15:30, Julian Brown wrote: On Fri, 23 Sep 2022 14:10:51 +0200 Tobias Burnus wrote: ... I added n->expr->expr_type == EXPR_VARIABLE to the condition -- I think that should suffice for now? Yes. A similar mean way to write code would be: integer, ta