[gomp4] Make front ends emit warnings when OpenACC routines directives lack parallelism

2017-05-01 Thread Cesar Philippidis
lot of test cases to make them conform to the new routine behavior. This patch has been committed to gomp-4_0-branch. Cesar 2017-05-01 Cesar Philippidis gcc/fortran/ * gfortran.h (enum oacc_function): Add OACC_FUNCTION_AUTO. * openmp.c (gfc_oacc_routine_dims): Return OACC_FUNCTION_AUTO whe

[gomp4] Make OpenACC orphan gang reductions errors

2017-05-01 Thread Cesar Philippidis
reduction finalizer uses an atomic update. However, because there is no synchronization between gangs, there is way to guarantee that reduction will have completed once a single gang entity returns from the acc routine call. I've applied this patch to gomp-4_0-branch. Cesar 2017-05-01

[gomp4] Fix an ICE involving OpenACC routines inside broken fortran functions.

2017-04-27 Thread Cesar Philippidis
27;ve applied this patch to gomp-4_0-branch. Cesar 2017-04-27 Cesar Philippidis gcc/fortran/ * openmp.c (gfc_match_oacc_routine): Don't match OpenACC routines when the current function failed to parse due to a syntax error. gcc/testsuite/ * gfortran.dg/goacc/routine-10.f90: New te

[gomp4] Update error messages for c and c++ reductions

2017-04-26 Thread Cesar Philippidis
. It also fixes an ICE involving invalid struct member reductions in c. I've committed this patch to gomp-4_0-branch. Cesar 2017-04-26 Cesar Philippidis gcc/c/ * c-parser.c (c_parser_omp_variable_list): New c_omp_region_type argument. Use it to specialize handling of OMP_CLAUSE_REDU

Re: [gomp4] add support for allocatable scalars in OpenACC declare constructs

2017-04-20 Thread Cesar Philippidis
On 04/20/2017 01:08 AM, Thomas Schwinge wrote: > On Wed, 19 Apr 2017 11:11:39 -0700, Cesar Philippidis > wrote: >> Included in this patch is a bug fix for non-declared allocatable >> scalars. [...] > > Please, bug fixes as work items/patches/commits separate from new

[gomp4] add support for allocatable scalars in OpenACC declare constructs

2017-04-19 Thread Cesar Philippidis
offloaded region, lower_omp_target will create a local copy of the pointed to value on target and along with a local pointer to it. Cesar 2017-04-19 Cesar Philippidis gcc/fortran/ * trans-decl.c (add_clause): Populate sym->backend_decl so that it can be used to determine if two symbols are uni

Re: [gomp4] add support for fortran allocate support with declare create

2017-04-06 Thread Cesar Philippidis
" -- which one should it be? I'm bad at noticing new unresolved test cases. It could be either, but I changed it to original to ensure that the fortran FE inserts those acc enter/exit data directives appropriately. This patch has been committed to gomp-4_0-branch. Cesar 2017-04-06 Cesa

Re: [patch,gomp4] add support for fortran common blocks

2017-04-05 Thread Cesar Philippidis
On 04/05/2017 01:22 PM, Thomas Schwinge wrote: >> --- a/gcc/gimplify.c >> +++ b/gcc/gimplify.c >> @@ -6102,14 +6102,19 @@ oacc_default_clause (struct gimplify_omp_ctx *ctx, >> tree decl, unsigned flags) >> { >>const char *rkind; >>bool on_device = false; >> + bool is_private = false; >

[gomp4] add support for fortran allocate support with declare create

2017-04-05 Thread Cesar Philippidis
and possibly other fortran runtime changes. I've applied this patch to gomp-4_0-branch. Cesar 2017-04-05 Cesar Philippidis gcc/fortran/ * gfortran.h (enum gfc_omp_map_op): Add OMP_MAP_DECLARE_ALLOCATE, OMP_MAP_DECLARE_DEALLOCATE. * openmp.c (gfc_match_oacc_declare): Add support for

Re: [gomp4] backport misc OMP 4.5 changes from trunk

2017-04-05 Thread Cesar Philippidis
On 03/16/2017 07:13 AM, Thomas Schwinge wrote: >> --- a/gcc/gimplify.c >> +++ b/gcc/gimplify.c > >> @@ -6636,9 +6596,9 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq >> *pre_p, >>ctx = new_omp_context (region_type); >>ctx->clauses = *list_p; >>outer_ctx = ctx->outer_context;

[gomp4] update parsing for the bind clause in fortran

2017-03-31 Thread Cesar Philippidis
the middle end. Also, due to the parsing changes, I had to xfail routine-8.f90 because it no longer fails to compile. However, because bind is unimplemented in the ME, this test fails to link since the bound names are missing. I'll apply this patch to gomp-4_0-branch shortly. Cesar 2017

[gomp4] fix an ICE involving derived-typed subarray

2017-03-31 Thread Cesar Philippidis
I'll apply this patch to gomp-4_0-branch shortly which fixes an ICE triggered by using data clauses with derived-type subarray arguments. Such subarrays can be handled generically. Cesar 2017-03-31 Cesar Philippidis gcc/fortran/ * trans-openmp.c (gfc_trans_omp_clauses_1): Update handli

Re: [PATCH] Fix PR80029

2017-03-22 Thread Cesar Philippidis
On 03/22/2017 06:42 AM, Jakub Jelinek wrote: >> 2017-03-22 Cesar Philippidis >> >> PR c++/80029 >> >> gcc/ >> * gimplify.c (is_oacc_declared): New function. >> (oacc_default_clause): Use it to set default flags for acc declared

[PATCH] Fix PR80029

2017-03-22 Thread Cesar Philippidis
OK for trunk? Cesar 2017-03-22 Cesar Philippidis PR c++/80029 gcc/ * gimplify.c (is_oacc_declared): New function. (oacc_default_clause): Use it to set default flags for acc declared variables inside parallel regions. (gimplify_scan_omp_clauses): Strip firstprivate pointers for acc de

[gomp4] cleanup trans-stmt.h

2017-03-14 Thread Cesar Philippidis
I noticed that gcc/fortran/trans-stmt.h made a reference to a non-existent trans-openacc.c. Those functions have been placed in trans-openmp.c. This patch has been applied to gomp-4_0-branch to correct that error. Cesar 2017-03-14 Cesar Philippidis gcc/fortran/ * trans-stmt.h: Remove stale

[gomp4] add support for gang local storage allocation in shared memory

2017-02-27 Thread Cesar Philippidis
locally on a per-function basis. We're not sure if that matters though. This patch has been applied to gomp-4_0-branch. Cesar 2017-02-27 Chung-Lin Tang Cesar Philippidis gcc/c/ * c-parser.c (mark_vars_oacc_gangprivate): New function. (c_parser_oacc_kernels_parallel): Call it to m

Re: [gomp4] add -finform-parallelism

2017-02-23 Thread Cesar Philippidis
On 02/22/2017 12:17 AM, Thomas Schwinge wrote: > On Mon, 20 Feb 2017 20:42:59 -0800, Cesar Philippidis > wrote: >> --- a/gcc/omp-low.c >> +++ b/gcc/omp-low.c > >> +/* Provide diagnostics on OpenACC loops LOOP, its siblings and its >> + children. */ >>

[gomp4] backport OPTGROUP_OPENMP

2017-02-23 Thread Cesar Philippidis
ept it OPTGROUP_OPENMP. If you want, I can backport your patch once it gets merged into trunk. I applied this patch to gomp-4_0-branch. Cesar 2017-02-23 Cesar Philippidis Backport from trunk: 2016-11-23 Martin Jambor Martin Liska gcc/ * doc/optinfo.texi (Optimization groups): Do

[gomp4] delete unused variable inside trans-openmp.c

2017-02-22 Thread Cesar Philippidis
I've applied this patch to gomp-4-0-branch to remove an unused variable inside trans-openmp.c. I'm not sure why bootstrapping does catch this sort of error anymore. Maybe my build script of overriding the build flags some how. Cesar 2017-02-22 Cesar Philippidis gcc/fortran/ * tran

[gomp4] correct the reported line number in fortran combined OpenACC directives

2017-02-22 Thread Cesar Philippidis
f the ME tries to use those locations. I had originally posted the patch here <https://gcc.gnu.org/ml/gcc-patches/2017-02/msg01256.html>, but Thomas asked me to put it in a separate patch. This patch has been applied to gomp-4_0-branch. Cesar 2017-02-22 Cesar Philippidis gcc/fortra

[gomp4] correct the reported line number in c++ combined OpenACC directives

2017-02-22 Thread Cesar Philippidis
can get around to creating a patch for trunk later this week. Cesar 2017-02-22 Cesar Philippidis gcc/cp/ * parser.c (cp_parser_oacc_kernels_parallel): Adjust EXPR_LOCATION on the combined acc loop. gcc/testsuite/ * c-c++-common/goacc/combined-directives-3.c: New test. * c-c++-comm

[gomp4] add -finform-parallelism

2017-02-20 Thread Cesar Philippidis
we can extend these diagnostics to report any detected loops inside kernels regions. Cesar 2017-02-20 Cesar Philippidis gcc/ * common.opt (finform-parallelism): New option. * omp-low.c (inform_oacc_loop): New function. (execute_oacc_device_lower): Use it to report how ACC LOOPs are assigned pa

Re: [gomp4] adjust num_gangs and add a diagnostic for unsupported num_workers

2017-02-17 Thread Cesar Philippidis
On 02/15/2017 01:29 PM, Thomas Schwinge wrote: > On Mon, 13 Feb 2017 08:58:39 -0800, Cesar Philippidis > wrote: >> @@ -952,25 +958,30 @@ nvptx_exec (void (*fn), size_t mapnum, void >> **hostaddrs, void **devaddrs, >>CUdevice dev = nvptx_thread()->ptx_dev-&

Re: Re: Improving code generation in the nvptx back end

2017-02-17 Thread Cesar Philippidis
On 02/17/2017 05:09 AM, Thomas Schwinge wrote: > On Fri, 17 Feb 2017 14:00:09 +0100, I wrote: >> [...] for "normal" functions there is no reason to use the >> ".param" space for passing arguments in and out of functions. We can >> then get rid of the boilerplate code to move ".param %in_ar*" into

[gomp4] adjust num_gangs and add a diagnostic for unsupported num_workers

2017-02-13 Thread Cesar Philippidis
give the end user some performance hints. E.g., recompile your program with -fopenacc-dim=-:num_workers. This patch has been applied to gomp-4_0-branch. Cesar 2017-02-13 Cesar Philippidis libgomp/ * plugin/plugin-nvptx.c (nvptx_exec): Adjust the default num_gangs. Add diagnostic when t

[gomp4] fix a reduction bug involving GOMP_MAP_FIRSTPRIVATE_POINTER variables

2017-02-08 Thread Cesar Philippidis
applied to gomp-4_0-branch. Cesar 2017-02-08 Cesar Philippidis gcc/ * config/nvptx/nvptx.c (nvptx_adjust_reduction_type): New function. (nvptx_goacc_reduction_setup): Use it to adjust the type of ref_to_res. (nvptx_goacc_reduction_fini): Likewise. (nvptx_goacc_reduction_teardown): Likewi

Re: [gomp4] optimize GOMP_MAP_TO_PSET

2017-02-02 Thread Cesar Philippidis
On 01/30/2017 02:26 AM, Thomas Schwinge wrote: > ... also there is some bug somewhere; I see: > > PASS: libgomp.fortran/examples-4/async_target-2.f90 -O0 (test for > excess errors) > [-PASS:-]{+FAIL:+} libgomp.fortran/examples-4/async_target-2.f90 -O0 > execution test > PASS:

Re: [gomp4] enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC

2017-02-01 Thread Cesar Philippidis
On 01/30/2017 02:18 AM, Thomas Schwinge wrote: > Hi Cesar! > > On Fri, 27 Jan 2017 07:45:52 -0800, Cesar Philippidis > wrote: >> If you take a close look at lower_omp_target, you'll notice that I'm >> gave reference types special treatment. Specifically, I di

Re: [gomp4] add support for derived types in ACC UPDATE

2017-02-01 Thread Cesar Philippidis
On 01/30/2017 02:08 AM, Thomas Schwinge wrote: > Hi Cesar! > > On Thu, 10 Nov 2016 09:38:33 -0800, Cesar Philippidis > wrote: >> This patch has been committed to gomp-4_0-branch. > >> --- a/gcc/fortran/openmp.c >> +++ b/gcc/fortran/openmp.c > >> @@ -2

Re: [gomp4] optimize GOMP_MAP_TO_PSET

2017-01-30 Thread Cesar Philippidis
On 01/30/2017 02:26 AM, Thomas Schwinge wrote: > On Fri, 27 Jan 2017 08:06:22 -0800, Cesar Philippidis > wrote: >> This is probably because CloverLeaf makes use >> of ACC DATA regions in the critical sections, so all of those PSETs and >> POINTERs are already p

[gomp4] partially enable GOMP_MAP_FIRSTPRIVATE_POINTER in gfortran

2017-01-27 Thread Cesar Philippidis
eck. One way to get around this is to pass in the remapped decl pointers as arguments to cuLaunchKernel directly. Maybe we can do that during oaccdevlow for nvptx targets. The next big thing, however, probably should be updating the default launch geometry again. This patch has been committed

[gomp4] optimize GOMP_MAP_TO_PSET

2017-01-27 Thread Cesar Philippidis
This patch optimizes GOMP_MAP_TO_PSET in libgomp by installing the remapped pointer to the array data directly in the PSET, instead of uploading it separately with GOMP_MAP_POINTER. Effectively this eliminates the GOMP_MAP_POINTER that is associated with the PSET, thereby eliminating an additional

[gomp4] enable GOMP_MAP_FIRSTPRIVATE_INT in OpenACC

2017-01-27 Thread Cesar Philippidis
set for CloverLeaf that only ran in 1.3s without the patch, and hence make it even more I/O limited. After the patch, it ran 0.35s faster. This patch has been applied to gomp-4_0-branch. Cesar 2017-01-27 Cesar Philippidis gcc/ * omp-low.c (maybe_lookup_field_in_outer_ctx): New function. (co

Re: [gomp4] don't error on implicitly private induction variables in gfortran

2017-01-27 Thread Cesar Philippidis
On 01/27/2017 07:07 AM, Jakub Jelinek wrote: > On Fri, Jan 27, 2017 at 07:02:45AM -0800, Cesar Philippidis wrote: >> diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c >> index 61940d7..2782a8d 100644 >> --- a/gcc/fortran/openmp.c >> +++ b/gcc/fortran/ope

[gomp4] don't error on implicitly private induction variables in gfortran

2017-01-27 Thread Cesar Philippidis
While experimenting with some new OpenACC benchmarks, I noticed that gfortran errors when the user explicitly marks loop induction variables as private. I applied this patch to gomp-4_0-branch to resolve that problem. Cesar 2017-01-26 Cesar Philippidis gcc/fortran/ * openmp.c

Re: Re: [PATCH 0/5] OpenMP/PTX: improve correctness in SIMD regions

2017-01-19 Thread Cesar Philippidis
On 01/18/2017 06:22 AM, Richard Biener wrote: > On Wed, Jan 18, 2017 at 3:11 PM, Alexander Monakov wrote: >> On Wed, 18 Jan 2017, Richard Biener wrote: After OpenMP lowering, inlining might break this by inlining functions with address-taken locals into SIMD regions. For now, such inlin

[gomp4] backport an acc directive matching cleanup for fortran

2017-01-03 Thread Cesar Philippidis
to backport Jakub's OpenMP 4.5 fortran changes to gomp4. Cesar 2017-01-03 Cesar Philippidis gcc/fortran/ * openmp.c (match_acc): New function. (gfc_match_oacc_parallel_loop): Simplify by calling match_acc. (gfc_match_oacc_parallel): Likewise. (gfc_match_oacc_kernels

Re: [PATCH] omp-low.c split

2016-12-13 Thread Cesar Philippidis
On 12/13/2016 04:42 AM, Martin Jambor wrote: >> And this as well. But omp-grid.c is fine too. > > ...I prefer omp-grid.c because I plan to use gridification also for > GCN targets, though hopefully only as an optimization rather than a > hard requirement ...and in fact I still think it is a good

Re: [PATCH] Fix PR78027

2016-12-09 Thread Cesar Philippidis
On 12/09/2016 07:49 AM, Alexander Monakov wrote: > On Fri, 9 Dec 2016, Cesar Philippidis wrote: >>> Normally all offloaded code has either "omp declare target" (most >>> functions) or >>> "omp target entrypoint" (only toplevel offloaded code)

Re: [PATCH] Fix PR78027

2016-12-09 Thread Cesar Philippidis
On 12/09/2016 06:56 AM, Alexander Monakov wrote: > On Thu, 8 Dec 2016, Jeff Law wrote: >>> PR fortran/78027 >>> >>> gcc/ >>> * ipa-icf.c (sem_function::parse): Don't process functions with >>> oacc decl attributes, as they may be OpenACC routines. >>> >>> gcc/testsuite/ >>>

OpenACC Patch Ping

2016-12-09 Thread Cesar Philippidis
The following patches still need to be reviewed. ACC ROUTINE patches: Re: [PATCH] OpenACC routines -- c++ front end Re: [PATCH] OpenACC routines -- middle end Re: [PATCH] OpenAC

Re: [nvptx] propagating conditionals in worker-vector partitioned loops

2016-12-09 Thread Cesar Philippidis
Ping. On 10/26/2016 03:29 PM, Cesar Philippidis wrote: > Currently, the nvptx backend is only neutering the worker axis when > propagating variables used in conditional expressions across the worker > and vector axes. That's a problem with the worker-state spill and fill

Re: [PATCH] Fix PR78027

2016-12-09 Thread Cesar Philippidis
On 12/08/2016 04:37 PM, Jeff Law wrote: > On 12/08/2016 04:05 PM, Cesar Philippidis wrote: >> PR78027 was classified as a fortran bug, but the underlying problem >> turned out to be more generic. Basically, the IPA-ICF pass usually >> ignores functions with omp decl attribu

[PATCH] Fix PR78027

2016-12-08 Thread Cesar Philippidis
linker does report an error for nvptx targets, but not the host. With that in mind, this patch is still necessary for case 1. Is this OK for trunk? Cesar 2016-12-08 Cesar Philippidis PR fortran/78027 gcc/ * ipa-icf.c (sem_function::parse): Don't process functions with oacc decl attri

[gomp4] fix implicit data clause linker error

2016-12-06 Thread Cesar Philippidis
global variable definitions aren't included inside the offloaded LTO partitions. I've applied this fix to gomp-4_0-branch. Cesar 2016-12-06 Cesar Philippidis gcc/ * gimplify.c (gimplify_adjust_omp_clauses_1): Link ACC new clauses with the old ones. gcc/testsuite/ * c-c++-commo

Re: [PATCH] OpenACC executable directives

2016-12-02 Thread Cesar Philippidis
On 12/02/2016 06:37 AM, Cesar Philippidis wrote: > This patch teaches the C and C++ FEs to expect ACC ENTER/EXIT DATA, ACC > UPDATE and ACC WAIT executable directives to be used inside compound > statements. This is to prevent situations such as > > if (needs_wait) >

[PATCH] OpenACC executable directives

2016-12-02 Thread Cesar Philippidis
This patch teaches the C and C++ FEs to expect ACC ENTER/EXIT DATA, ACC UPDATE and ACC WAIT executable directives to be used inside compound statements. This is to prevent situations such as if (needs_wait) #pragma acc wait // do something else here from generating unexpected code when t

Re: [Patch 4/5] OpenACC tile clause support, Fortran front-end parts

2016-11-29 Thread Cesar Philippidis
On 11/18/2016 03:24 AM, Jakub Jelinek wrote: > On Sat, Nov 12, 2016 at 08:51:00AM -0800, Cesar Philippidis wrote: >> On 11/11/2016 02:34 AM, Jakub Jelinek wrote: >>> On Thu, Nov 10, 2016 at 06:46:46PM +0800, Chung-Lin Tang wrote: >> >> And here's the patch. >

Re: [PATCH] OpenACC routines -- c++ front end

2016-11-22 Thread Cesar Philippidis
On 11/11/2016 03:43 PM, Cesar Philippidis wrote: > Like it's c FE counterpart, this contains the following changes: > > * Updates c_parser_oacc_shape_clause to accept a location_t >argument in order to make the diagnostics more precise. > > * Adds support for the

Re: [PATCH] OpenACC routines -- middle end

2016-11-22 Thread Cesar Philippidis
On 11/22/2016 11:58 AM, Jakub Jelinek wrote: > On Tue, Nov 22, 2016 at 11:53:50AM -0800, Cesar Philippidis wrote: >> I've incorporated those changes in this patch. Is it ok for trunk? > > The ChangeLog mentions omp-low.[ch] changes, but the patch doesn't include > th

Re: [PATCH] OpenACC routines -- fortran front end

2016-11-22 Thread Cesar Philippidis
On 11/18/2016 04:29 AM, Jakub Jelinek wrote: > On Fri, Nov 11, 2016 at 03:44:07PM -0800, Cesar Philippidis wrote: >> --- a/gcc/fortran/gfortran.h >> +++ b/gcc/fortran/gfortran.h >> @@ -314,6 +314,15 @@ enum save_state >> { SAVE_NONE = 0, SAVE_EXPLICIT, SAVE_IMPLICIT

Re: [PATCH] OpenACC routines -- c front end

2016-11-22 Thread Cesar Philippidis
On 11/18/2016 04:21 AM, Jakub Jelinek wrote: > On Fri, Nov 11, 2016 at 03:43:23PM -0800, Cesar Philippidis wrote: >> @@ -11801,12 +11807,11 @@ c_parser_oacc_shape_clause (c_parser *parser, >> omp_clause_code kind, >> } >> >>location_t expr_

Re: [PATCH] OpenACC routines -- middle end

2016-11-22 Thread Cesar Philippidis
On 11/18/2016 04:14 AM, Jakub Jelinek wrote: > On Fri, Nov 11, 2016 at 03:43:02PM -0800, Cesar Philippidis wrote: >> +error_at (OMP_CLAUSE_LOCATION (c), >> + "%qs specifies a conflicting level of parallelism", >> + omp_clau

[gomp4] remove use of CUDA unified memory in libgomp

2016-11-18 Thread Cesar Philippidis
the cuda_maps, but that can be optimized with a different data structure later. I've applied this patch to gomp-4_0-branch. Cesar 2016-11-18 Cesar Philippidis libgomp/ * plugin/plugin-nvptx.c (struct cuda_map): New. (struct ptx_stream): Replace d, h, h_begin, h_end, h_next, h_

[gomp4] backport various runtime changes

2016-11-16 Thread Cesar Philippidis
11-16 Cesar Philippidis Backport from trunk: 2016-05-26 Chung-Lin Tang libgomp/ * target.c (gomp_device_copy): New function. (gomp_copy_host2dev): Likewise. (gomp_copy_dev2host): Likewise. (gomp_free_device_memory): Likewise. (gomp_map_vars_existing): Adjust to call gomp_copy_hos

Re: [Patch 4/5] OpenACC tile clause support, Fortran front-end parts

2016-11-12 Thread Cesar Philippidis
On 11/11/2016 02:34 AM, Jakub Jelinek wrote: > On Thu, Nov 10, 2016 at 06:46:46PM +0800, Chung-Lin Tang wrote: And here's the patch. Cesar >> 2016-XX-XX Cesar Philippidis >> >> fortran/ >> * openmp.c (resolve_oacc_positive_int_expr): Promote

[PATCH] OpenACC routines -- test cases

2016-11-11 Thread Cesar Philippidis
This patch contains new and adjusted, runtime and compiler test cases for the new OpenACC routine functionality. Is this ok for trunk? Cesar 2016-11-11 Cesar Philippidis Thomas Schwinge gcc/testsuite/ * c-c++-common/goacc/routine-1.c: Add more coverage. * c-c++-common/goacc

[PATCH] OpenACC routines -- fortran front end

2016-11-11 Thread Cesar Philippidis
closely related. Last time I posted the module patch someone raised the concern that this change would break backwards compatibility. Considering this patch is for GCC 7, perhaps the module version number can be bumped to address that problem. Is this patch ok for trunk? Cesar 2016-11-11 Cesar

[PATCH] OpenACC routines -- c++ front end

2016-11-11 Thread Cesar Philippidis
Like it's c FE counterpart, this contains the following changes: * Updates c_parser_oacc_shape_clause to accept a location_t argument in order to make the diagnostics more precise. * Adds support for the bind and nohost clauses. * Adds more diagnostics for invalid acc routines. Is this pa

[PATCH] OpenACC routines -- c front end

2016-11-11 Thread Cesar Philippidis
? Cesar 2016-11-11 Cesar Philippidis Thomas Schwinge gcc/c/ * c-parser.c (c_parser_omp_clause_name): Handle OpenACC bind and nohost. (c_parser_oacc_shape_clause): New location_t loc argument. Use it to report more accurate diagnostics. (c_parser_oacc_simple_clause): Likewise

[PATCH] OpenACC routines -- middle end

2016-11-11 Thread Cesar Philippidis
and gimplification code for diagnostics and code generation. I've also included the changes to c-family, because I wanted to break out the FE changes into separate patches. Is this patch OK for trunk? Cesar 2016-11-11 Cesar Philippidis Thomas Schwinge gcc/c-family/ * c-attr

[gomp4] remove OMP_CLAUSE_DEVICE_RESIDENT

2016-11-10 Thread Cesar Philippidis
I've committed this patch to gomp-4_0-branch which removes OMP_CLAUSE_DEVICE_RESIDENT. This standalone clause is no longer necessary, and hasn't been for a while, because device_resident is treated as a data mapping type for OMP_CLAUSE_MAP, and not a clause itself. Cesar 2016-11

[gomp4] add support for derived types in ACC UPDATE

2016-11-10 Thread Cesar Philippidis
o let ACC UPDATE support non-contiguous subarrays, but it already is an oddball with its lone support for derived types. This patch has been committed to gomp-4_0-branch. Cesar 2016-11-10 Cesar Philippidis gcc/fortran/ * openmp.c (gfc_match_omp_variable_list): New allow_derived arg

[openacc] add support for common block data

2016-11-07 Thread Cesar Philippidis
n block as a whole. This patch has been in gomp-4_0-branch for over a month, you can find the original patch here <https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00950.html>. Is this patch ok for trunk? Cesar 2016-11-07 Cesar Philippidis gcc/fortran/ * openmp.c (gfc_match_omp_

[gomp4] remove GOVD_USE_DEVPTR

2016-11-07 Thread Cesar Philippidis
this patch remove GOVD_USE_DEVPTR from gomp4. Cesar 2016-11-07 Cesar Philippidis gcc/fortran/ * openmp.c (gfc_match_omp_map_clause): New common_block argument. Propagate it to gfc_match_omp_variable_list. (gfc_match_omp_clauses): Update calls to gfc_match_omp_map_clause. gcc/ *

[gomp4] backport nvptx_exec cleanups

2016-11-07 Thread Cesar Philippidis
I've applied this patch to gomp-4_0-branch. Cesar 2016-11-07 Cesar Philippidis libgomp/ Backport from trunk 2016-11-02 Cesar Philippidis Nathan Sidwell * plugin/plugin-nvptx.c (nvptx_exec): Interrogate board attributes to determine default geometry. diff --git a/libgomp/pl

Re: [gomp4] Un-parallelized OpenACC kernels constructs with nvptx offloading: "avoid offloading" (was: [PATCH] Add fopt-info-oacc)

2016-11-03 Thread Cesar Philippidis
../kernels-private-vars-loop-vector-2.f90 | 2 + > .../kernels-private-vars-loop-worker-1.f90 | 2 + > .../kernels-private-vars-loop-worker-2.f90 | 2 + > .../kernels-private-vars-loop-worker-3.f90 | 2 + > .../kernels-private-vars-loop-worker-4.f90 | 2 + > ..

[openacc] add warnings for unused parallelism

2016-11-03 Thread Cesar Philippidis
cross a specific axis. Is this patch OK for trunk? This patch was originally posted by Nathan here <https://gcc.gnu.org/ml/gcc-patches/2016-01/msg00210.html>. Most of the changes in that patch are already in trunk. Cesar 2016-11-03 Cesar Philippidis Nathan Sidwell gcc/

Re: [openacc] adjust default num_gangs

2016-11-02 Thread Cesar Philippidis
On 11/02/2016 12:50 PM, Jakub Jelinek wrote: > On Wed, Nov 02, 2016 at 12:34:47PM -0700, Cesar Philippidis wrote: >> @@ -932,9 +933,84 @@ nvptx_exec (void (*fn), size_t mapnum, void >> **hostaddrs, void **devaddrs, >> >>if (seen_zero) >> { >

[openacc] adjust default num_gangs

2016-11-02 Thread Cesar Philippidis
arbitrarily. At least this value maps onto a hardware value. More details regarding this patch can be found here: https://gcc.gnu.org/ml/gcc-patches/2016-08/msg02064.html https://gcc.gnu.org/ml/gcc-patches/2016-08/msg02084.html Is this patch OK for trunk? Cesar 2016-11-02 Cesar Philippidis

[gomp4] propagating conditionals in worker-vector partitioned loops

2016-10-28 Thread Cesar Philippidis
sar 2016-10-26 Cesar Philippidis gcc/ * config/nvptx/nvptx.c (nvptx_single): Use a single predicate for loops partitioned across both worker and vector axes. libgomp/ * testsuite/libgomp.oacc-c-c++-common/broadcast-1.c: New test. diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nv

[nvptx] propagating conditionals in worker-vector partitioned loops

2016-10-26 Thread Cesar Philippidis
s can be predicated together, not separately. I.e., instead of first neutering worker axis, then neutering the vector axis, this patch uses a single predicate for tid.x == 0 && tid.y == 0. Is this patch ok for trunk? Cesar 2016-10-26 Cesar Philippidis gcc/ * config/nvptx/nvptx.c

Re: PING! Re: [PATCH, Fortran] Extension: COTAN and degree-valued trig intrinsics with -fdec-math

2016-10-25 Thread Cesar Philippidis
n you try to run 'make pdf'. The attached adds a mathop for cosd. Is this patch OK for trunk? Cesar 2016-10-25 Cesar Philippidis gcc/fortran/ * intrinsic.texi (cosd): New mathop. diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 16e1d5c..85f781e

[gomp4] correct a tile bug with combined loops in fortran

2016-10-05 Thread Cesar Philippidis
the tile clause is only associated with do_clauses. This patch teaches gfc_trans_omp_do to check for the tile clause in both code and do_clauses. I've applied this patch to gomp-4_0-branch. Cesar 2016-10-05 Cesar Philippidis gcc/fortran/ * trans-openmp.c (gfc_trans_omp_do): Check do_cl

[gomp4] update tile clause lowering in fortran

2016-10-04 Thread Cesar Philippidis
that the fortran FE permitted acc loops to contain both tile and collapse clauses. This patch also makes that an error like it is in C and C++. This patch has been applied to gomp-4_0-branch. Cesar 2016-10-04 Cesar Philippidis gcc/fortran/ * openmp.c (resolve_omp_clauses): Error on direc

Re: Re: [PATCH, OpenACC, Fortran] Fix PR77371, ICE on allocatable

2016-10-03 Thread Cesar Philippidis
On 10/03/2016 07:59 AM, Jakub Jelinek wrote: > with -fopenmp. The var is actually properly allocatable in the latter case, > while it is not with your patch on the first testcase, you just copy over the > host pointer, that > is definitely not going to work on non-shared memory offloading. I th

[gomp4] map the '*' tile argument onto integer_zero_node in fortran

2016-10-03 Thread Cesar Philippidis
2016-10-03 Cesar Philippidis gcc/fortran/ * openmp.c (resolve_oacc_loop_blocks): Use integer zero to represent the '*' tile argument. gcc/testsuite/ * gfortran.dg/goacc/tile-lowering.f95: New test. diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 399b5d1..

[gomp4] update gfortran's tile clause error handling

2016-10-03 Thread Cesar Philippidis
updated to accommodate this new behavior. I've applied it to gomp-4_0-branch. Nathan, I haven't looked too deeply into your tile changes yet. Do you know of the fortran FE is doing anything wrong? I haven't checked if it's lowering the tile clause in the proper format yet. Ces

[gomp4] fix an ICE with acc declared VLAs

2016-09-23 Thread Cesar Philippidis
I've applied this patch to gomp4 which fixes a problem with VLA variables in data clauses used in acc declare directives. More details regarding this fix can be found here <https://gcc.gnu.org/ml/gcc-patches/2016-09/msg01630.html>. Cesar 2016-09-23 Cesar Philippidis gcc/ *

[openacc] fix an ICE with acc declared VLAs

2016-09-22 Thread Cesar Philippidis
plify omp ctx. The only other major thing that had to be updated was oacc_default_clause, because omp_notice_variable no longer has a gimple omp ctx to inspect for existing variables. But that's where the "oacc declare target" attribute comes into play. Is this patch OK for t

Re: [patch, libgomp, OpenACC] Additional enter/exit data map handling

2016-09-20 Thread Cesar Philippidis
On 08/29/2016 12:46 AM, Chung-Lin Tang wrote: > Index: oacc-parallel.c > === > --- oacc-parallel.c (revision 239814) > +++ oacc-parallel.c (working copy) > @@ -38,15 +38,23 @@ > #include > #include > > +/* Returns the number

Re: [patch,gomp4] Fix PR74600

2016-09-15 Thread Cesar Philippidis
On 09/09/2016 03:34 PM, Cesar Philippidis wrote: > By design, the libgomp OpenACC runtime prohibits data clauses with > aliased addresses from being used in the same construct. E.g., the user > is not allowed to specify > > #pragma acc parallel copy(var[0:10]) copy(pvar[0:10])

[patch,gomp4] add support for fortran common blocks

2016-09-15 Thread Cesar Philippidis
rwise the privatized common block data would be used instead of one that was explicitly or implicitly transferred to the accelerator. This patch has been committed to gomp-4_0-branch. Cesar 2016-09-15 Cesar Philippidis gcc/fortrann/ * openmp.c (gfc_match_omp_map_clause): Add new common_blocks arg

[patch,gomp4] Fix PR74600

2016-09-09 Thread Cesar Philippidis
? If so, what do you think about this solution? It would have to be modified for OpenMP targets though. Cesar 2016-09-09 Cesar Philippidis PR fortran/74600 gcc/ * tree-nested.c (convert_nonlocal_reference_stmt): Create a private clause for the CHAIN stack frame. (convert_local_reference_stm

[gomp4] fix an ICE involving assumed-size arrays

2016-08-30 Thread Cesar Philippidis
ility. Perhaps I should a warning for implicitly used assumed-sizes arrays? I've applied this patch to gomp-4_0-branch. It looks like OpenMP has a similar problem. Cesar 2016-08-30 Cesar Philippidis gcc/ * omp-low.c (lower_omp_target): Handle NULL-sized types for assumed-sized arrays.

[patch] Fix PR72715

2016-08-29 Thread Cesar Philippidis
runk, gcc-6 and gcc-5? Cesar 2016-08-29 Cesar Philippidis PR fortran/72715 gcc/fortran/ * openmp.c (resolve_oacc_nested_loops): Error on do concurrent loops. gcc/testsuite/ * gfortran.dg/goacc/loop-3-2.f95: Error on do concurrent loops. * gfortran.dg/goacc/loop-3.f95: Likewise. * gfortra

[gomp4] check for sufficient parallelism when calling acc routines in fortran

2016-08-26 Thread Cesar Philippidis
c_routines pass in order to identify if a variable is a function or variable because that information isn't available during matching. I've applied this patch to gomp-4_0-branch. Cesar 2016-08-26 Cesar Philippidis gcc/fortran/ * gfortran.h (enum oacc_function): Make OACC_FUNCTION

[gomp4] adjust offsets for present data clauses

2016-08-23 Thread Cesar Philippidis
determined by gomp_map_vars, which this patch does. This issue was causing SPEC_ACCEL 304.olbm to generate bogus results and fail during specdiff. I've applied patch to gomp-4_0-branch. Cesar 2016-08-23 Cesar Philippidis libgomp/ * oacc-parallel.c (GOACC_parallel_keyed): Add offset to deva

Re: Repeated use of the OpenACC routine directive

2016-08-19 Thread Cesar Philippidis
ks and that warning for unutilized parallelism. I've applied this patch, which addresses the acc routine test coverage deficiencies in fortran, to gomp-4_0-branch. Cesar 2016-08-19 Cesar Philippidis gcc/testsuite/ * gfortran.dg/goacc/routine-8.f90: New test. * gfortran.dg/goacc/routine-level

Re: Repeated use of the OpenACC routine directive

2016-08-18 Thread Cesar Philippidis
On 08/16/2016 06:05 PM, Thomas Schwinge wrote: > commit bffb0ee6c0a83b8c85cd919e1172086b51fdc452 > Author: tschwinge > Date: Wed Aug 17 00:55:02 2016 + > > Repeated use of the C/C++ OpenACC routine directive > > gcc/ > * omp-low.c (verify_oacc_routine_clauses): Change

[patch,gomp4] fix pr70828

2016-08-17 Thread Cesar Philippidis
n the meantime, I'll apply this WIP patch to gomp-4_0-branch. Cesar 2016-08-17 Cesar Philippidis PR middle-end/70828 gcc/ * gimplify.c (struct gimplify_omp_ctx): Add tree clauses member. (new_omp_context): Initialize clauses to NULL_TREE. (gimplify_scan_omp_clauses): Set clau

Re: [WIP] [PR fortran/72741] Rework Fortran OpenACC routine clause handling

2016-08-15 Thread Cesar Philippidis
_routine_dims to generate the appropriate OACC_FUNCTION attribute for a given set of device_type clauses. Note that besides for checking for multiple acc routine directives, this patch also handles the case where the optional name argument in 'acc routine (NAME)' is the name of the curren

Re: [gomp4] Extend libgomp's fortran test coverage of host_data

2016-08-12 Thread Cesar Philippidis
On 08/11/2016 03:38 PM, Cesar Philippidis wrote: > This patch ports libgomp.oacc-c-c++-common/host_data-1.c to fortran. > Fortunately, the existing fortran host_data infrastructure was already > in place, so I had to do was port over the calls to Nvidia's CUDA BLAS > library.

[gomp4] Extend libgomp's fortran test coverage of host_data

2016-08-11 Thread Cesar Philippidis
linedocs/gfortran/Interoperability-with-C.html>. Basically, those library calls need a function interface with a special C binding. The function I tested in host_data-2.f90 is cublasSaxpy. Other function interfaces will need to be created as necessary. I've applied this patch to gomp-4_0-br

Re: [WIP] [PR fortran/72741] Rework Fortran OpenACC routine clause handling

2016-08-11 Thread Cesar Philippidis
On 08/11/2016 08:18 AM, Thomas Schwinge wrote: >> --- a/gcc/fortran/module.c >> +++ b/gcc/fortran/module.c > >> [...] >> +DECL_MIO_NAME (oacc_function) >> [...] > > As discussed between Cesar and Tobias, these module.c/symbol.c changes > introduce an incompatibility in the Fortran module file

Re: Use verify_oacc_routine_clauses for Fortran (was: Use verify_oacc_routine_clauses for C/C++)

2016-08-09 Thread Cesar Philippidis
On 08/01/2016 08:29 AM, Thomas Schwinge wrote: > On Mon, 01 Aug 2016 17:21:37 +0200, I wrote: >> Some checking of OpenACC clauses currently done in the front ends should >> be moved later, and be unified. (Also, I suppose, for supporting of the >> device_type clause, such checking actually *must*

[openacc] add a warning for non-contiguous data clauses

2016-08-02 Thread Cesar Philippidis
t if this patch is OK, I've decided to leave that as-is for now. Cesar 2016-08-02 Cesar Philippidis gcc/fortran/ * openmp.c (resolve_oacc_data_clauses): Emit a warning about a potentially non-contiguous array pointer. (resolve_omp_clauses): Extend coverage of OpenACC da

[gomp4] Fix PR72741

2016-07-28 Thread Cesar Philippidis
7;d like to see my other fortran module patch go in first. In the meantime, I'll commit this patch to gomp-4_0-branch. Cesar 2016-07-28 Cesar Philippidis PR fortran/72741 gcc/fortran/ * openmp.c (gfc_oacc_routine_dims): Move gfc_error to gfc_match_oacc_routine. Return OACC_FU

Re: [PATCH] OpenACC routines in fortran modules

2016-07-28 Thread Cesar Philippidis
On 07/28/2016 02:55 AM, Tobias Burnus wrote: > Cesar Philippidis wrote: >> It turns out that the acc routine parallelism isn't being recorded in >> fortran .mod files. This is a problem because then the ME can't validate >> if a routine has compatible parallelism wi

[gomp4] encode acc routine clauses inside fortran module files

2016-07-27 Thread Cesar Philippidis
. https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00043.html I've applied this patch gomp-4_0-branch. Cesar 2016-07-27 Cesar Philippidis gcc/fortran/ * gfortran.h (enum oacc_function): Define. (oacc_function_type): Declare. (symbol_attribute): Change the type of oacc_function from unsigne

<    1   2   3   4   5   6   7   >