[gomp4] Remove device-specific filtering during parsing for OpenACC

Julian Brown julian@codesourcery.com
Thu Jul 16 15:49:00 GMT 2015


Hi,

This patch removes the device-specific filtering (for NVidia PTX) from
the parsing stages of the host compiler (for the device_type clause --
separately for C, C++ and Fortran) in favour of fully parsing the
device_type clauses, but not actually implementing anything for them
(device_type support is a feature that we're not planning to implement
just yet: the existing "support" is something of a red herring).

With this patch, the parsed device_type clauses will be ready at OMP
lowering time whenever we choose to do something with them (e.g.
transforming them into a representation that can be streamed out and
re-read by the appropriate offload compiler). The representation is
more-or-less the same for all supported languages, modulo
clause ordering.

I've altered the dtype-*.* tests to account for the new behaviour (and
to not use e.g. mixed-case "nVidia" or "acc_device_nvidia" names, which
are contrary to the recommendations in the spec).

OK to apply, or any comments?

Thanks,

Julian

ChangeLog

    gcc/
    * gimplify.c (gimplify_scan_omp_clauses): Handle
    OMP_CLAUSE_DEVICE_TYPE.
    (gimplify_adjust_omp_clauses): Likewise.
    * omp-low.c (scan_sharing_clauses): Likewise.
    (expand_omp_target): Add "sorry" for device_type support.
    * tree-pretty-print.c (dump_omp_clause): Add device_type support.
    * tree.c (walk_tree_1): Likewise.

    gcc/c/
    * c-parser.c (c_parser_oacc_all_clauses): Don't call
    c_oacc_filter_device_types.
    * c-typeck.c (c_finish_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.

    gcc/cp/
    * parser.c (cp_parser_oacc_all_clauses): Don't call
    c_oacc_filter_device_types.
    * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_DEVICE_TYPE.
    * semantics.c (finish_omp_clauses): Likewise.

    gcc/fortran/
    * gfortran.h (gfc_omp_clauses): Change "dtype" int field to
    "device_types" gfc_expr_list.
    * openmp.c (gfc_match_omp_clauses): Remove scan_dtype variable (add
    OMP_CLAUSE_DEVICE_TYPE directly to appropriate bitmasks). Parse all
    device_type clauses without filtering.
    (OACC_LOOP_CLAUSE_DEVICE_TYPE_MASK)
    (OACC_KERNELS_CLAUSE_DEVICE_TYPE_MASK)
    (OACC_PARALLEL_CLAUSE_DEVICE_TYPE_MASK)
    (OACC_ROUTINE_CLAUSE_DEVICE_TYPE_MASK)
    (OACC_UPDATE_CLAUSE_DEVICE_TYPE_MASK): Add OMP_CLAUSE_DEVICE_TYPE.
    * trans-openmp.c (gfc_trans_omp_clauses): Translate device_type
    clauses, and split old body into...
    (gfc_trans_omp_clauses_1): New function.

    gcc/testsuite/
    * c-c++-common/goacc/dtype-1.c: Update test for new behaviour.
    * c-c++-common/goacc/dtype-2.c: Likewise.
    * c-c++-common/goacc/dtype-3.c: Likewise.
    * c-c++-common/goacc/dtype-4.c: Likewise.
    * gfortran.dg/goacc/dtype-1.f95: Likewise.
    * gfortran.dg/goacc/dtype-2.f95: Likewise.
    * gfortran.dg/goacc/dtype-3.f: Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: device-type-parsing-2.diff
Type: text/x-patch
Size: 36653 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150716/92b0514c/attachment.bin>


More information about the Gcc-patches mailing list