[PATCH, OpenACC] Fortran deviceptr

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

[PATCH, OpenACC] Fortran deviceptr

Chung-Lin Tang-5
Hi Thomas,
this is the updated Fortran deviceptr patche, originated from Cesar, and one of
the tests was from James Norris:

There were a few style cleanups, but the goal of modification is the same:
to use only one clause to represent Fortran deviceptr, and to preserve it
during gimplification.

Because of this modification, and as we discussed earlier, the handle_ftn_pointers()
code in libgomp/oacc-parallel.c appeared to be no longer needed.
I have remove them in this patch, and tested libgomp without regressions.

Also, I've added a new libgomp.oacc-fortran/deviceptr-2.f90 testcase that
actually copies out and verifies the deviceptr computation.

Is this okay for trunk now?


2019-10-18  Cesar Philippidis  <[hidden email]>
             Chung-Lin Tang  <[hidden email]>

        * trans-openmp.c (gfc_omp_finish_clause): Don't create pointer data
        mappings for deviceptr clauses.
        (gfc_trans_omp_clauses): Likewise.

        * gimplify.c (enum gimplify_omp_var_data): Add GOVD_DEVICETPR.
        (omp_notice_variable): Add GOVD_DEVICEPTR attribute when appropriate.
        (gimplify_scan_omp_clauses): Likewise.
        (gimplify_adjust_omp_clauses_1): Set GOMP_MAP_FORCE_DEVICEPTR for
        implicit deviceptr mappings.
        * c-c++-common/goacc/deviceptr-4.c: Update expected data mapping.

2019-10-18  Chung-Lin Tang  <[hidden email]>
             James Norris  <[hidden email]>

        * oacc-parallel.c (handle_ftn_pointers): Delete function.
        (GOACC_parallel_keyed): Remove call to handle_ftn_pointers.
        * testsuite/libgomp.oacc-fortran/deviceptr-1.f90: New test.
        * testsuite/libgomp.oacc-fortran/deviceptr-2.f90: New test.

openacc-fortran-deviceptr.patch (14K) Download Attachment
Reply | Threaded
Open this post in threaded view

Re: [PATCH, OpenACC] Fortran deviceptr

Bernhard Reutner-Fischer
On 19 October 2019 15:04:39 CEST, Bernhard Reutner-Fischer <[hidden email]> wrote:

>On 18 October 2019 17:08:54 CEST, Chung-Lin Tang
><[hidden email]> wrote:
>>Also, I've added a new libgomp.oacc-fortran/deviceptr-2.f90 testcase
>>actually copies out and verifies the deviceptr computation.
>In testcases please do not 'call abort' which is nonstandard but use
>'stop N' which is standard, ideally with different stop integers so one
>can see easily which test failed.
>We went through all of the testsuite a while ago to remove the
>nonstandard abort, FYI.

Like (modulo typos, untested):

$ cat abort_to_stop.awk ; echo EOF
# awk -f ./abort_to_stop.awk < foo.f90 > x && mv x foo.f90
BEGIN { IGNORECASE = 1; i = 1 }
{ while (sub(/call\s\s*abort/, "stop " i)) {let i++;}; print $0; }