[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 Cesar

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

2017-04-27 Thread Cesar Philippidis
applied this patch to gomp-4_0-branch. Cesar 2017-04-27 Cesar Philippidis <ce...@codesourcery.com> 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/rout

[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 <ce...@codesourcery.com> gcc/c/ * c-parser.c (c_parser_omp_variable_list): New c_omp_region_type argument. Use it to specialize ha

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 > <ce...@codesourcery.com> wrote: >> Included in this patch is a bug fix for non-declared allocatable >> scalars. [...] > > Please, bug fixes as work items/pat

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

2017-04-19 Thread Cesar Philippidis
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 <ce...@codesourcery.com> gcc/fortran/ * trans-decl.c (add_clause): Populate sym->backend_decl so that it can be used to determi

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 Cesar Philippid

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
ther fortran runtime changes. I've applied this patch to gomp-4_0-branch. Cesar 2017-04-05 Cesar Philippidis <ce...@codesourcery.com> 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

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
, 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-03-31 Cesar Philippidis <

[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 <ce...@codesourcery.com> gcc/fortran/ * trans-op

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 <ce...@codesourcery.com> >> >> PR c++/80029 >> >> gcc/ >> * gimplify.c (is_oacc_declared): New function. >> (oacc_default_clause): Use it to set

[PATCH] Fix PR80029

2017-03-22 Thread Cesar Philippidis
his OK for trunk? Cesar 2017-03-22 Cesar Philippidis <ce...@codesourcery.com> 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 firstpriv

[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 <ce...@codesourcery.com> gcc/f

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

2017-02-27 Thread Cesar Philippidis
er-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 <clt...@codesourcery.com> Cesar Philippidis <ce...@codesourcery.com> gcc/c/ * c-parser.c (mark_vars_oacc_gangprivate): New function. (c_par

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 > <ce...@codesourcery.com> wrote: >> --- a/gcc/omp-low.c >> +++ b/gcc/omp-low.c > >> +/* Provide diagnostics on OpenACC loops LOOP, its siblings and its >

[gomp4] backport OPTGROUP_OPENMP

2017-02-23 Thread Cesar Philippidis
I kept 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 <ce...@codesourcery.com> Backport from trunk: 2016-11-23 Martin Jambor <mjam...@suse.cz> Martin Liska <

[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 <ce...@codesourcery.com>

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

2017-02-22 Thread Cesar Philippidis
if 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 <ce...@codesourcery.c

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

2017-02-22 Thread Cesar Philippidis
to creating a patch for trunk later this week. Cesar 2017-02-22 Cesar Philippidis <ce...@codesourcery.com> 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.

[gomp4] add -finform-parallelism

2017-02-20 Thread Cesar Philippidis
these diagnostics to report any detected loops inside kernels regions. Cesar 2017-02-20 Cesar Philippidis <ce...@codesourcery.com> 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 as

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 > <ce...@codesourcery.com> wrote: >> @@ -952,25 +958,30 @@ nvptx_exec (void (*fn), size_t mapnum, void >> **hostaddrs, void **devaddrs, >>CUdevice 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*"

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

2017-02-13 Thread Cesar Philippidis
. 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 <ce...@codesourcery.com> libgomp/ * plugin/plugin-nvptx.c (nvptx_exec): Adjust the default num_gangs. Add diagnostic when the hardware

[gomp4] fix a reduction bug involving GOMP_MAP_FIRSTPRIVATE_POINTER variables

2017-02-08 Thread Cesar Philippidis
to gomp-4_0-branch. Cesar 2017-02-08 Cesar Philippidis <ce...@codesourcery.com> 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): Li

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 > <ce...@codesourcery.com> wrote: >> If you take a close look at lower_omp_target, you'll notice that I'm >> gave reference types special treat

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 > <ce...@codesourcery.com> wrote: >> This patch has been committed to gomp-4_0-branch. > >> --- a/gcc/fortran/openmp.c >> +++ b/gcc/

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 > <ce...@codesourcery.com> wrote: >> This is probably because CloverLeaf makes use >> of ACC DATA regions in the critical sections, so all of those PSETs and >&g

[gomp4] partially enable GOMP_MAP_FIRSTPRIVATE_POINTER in gfortran

2017-01-27 Thread Cesar Philippidis
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 to gomp-4_0-branch. Cesar 2017-01-27 Cesar

[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
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 <ce...@codesourcery.com> gcc/ * omp-low.c (maybe_lookup_field_in_outer_ctx): New fu

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 <ce...@codesourcery.com> gcc/f

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.

[gomp4] backport an acc directive matching cleanup for fortran

2017-01-03 Thread Cesar Philippidis
ckport Jakub's OpenMP 4.5 fortran changes to gomp4. Cesar 2017-01-03 Cesar Philippidis <ce...@codesourcery.com> 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_

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

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]

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 att

[PATCH] Fix PR78027

2016-12-08 Thread Cesar Philippidis
, 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 <ce...@codesourcery.com> PR fortran/78027 gcc/ * ipa-icf.c (sem_function::parse): Don't process functions with oacc decl attributes, as they may be O

[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 <ce...@codesourcery.com> gcc/ * gimplify.c (gimplify_adjust_omp_clauses_1): Link ACC new clauses with the old ones. gcc/tests

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

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 bind

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 > them. > H

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_IMPLIC

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
be optimized with a different data structure later. I've applied this patch to gomp-4_0-branch. Cesar 2016-11-18 Cesar Philippidis <ce...@codesourcery.com> libgomp/ * plugin/plugin-nvptx.c (struct cuda_map): New. (struct ptx_stream): Replace d, h, h_begin, h_end, h_next, h_prev,

[gomp4] backport various runtime changes

2016-11-16 Thread Cesar Philippidis
Cesar Philippidis <ce...@codesourcery.com> Backport from trunk: 2016-05-26 Chung-Lin Tang <clt...@codesourcery.com> libgomp/ * target.c (gomp_device_copy): New function. (gomp_copy_host2dev): Likewise. (gomp_copy_dev2host): Likewise. (gomp_free_device_memor

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 <ce...@codesourcery.com> >> >> fortran/ >> * openmp.c (resolve_oacc_positi

[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 <ce...@codesourcery.com> Thomas Schwinge <tho...@codesourcery.com> gcc/testsuite/ * c-c++-common/goacc

[PATCH] OpenACC routines -- fortran front end

2016-11-11 Thread Cesar Philippidis
, but they are 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

[PATCH] OpenACC routines -- c front end

2016-11-11 Thread Cesar Philippidis
? Cesar 2016-11-11 Cesar Philippidis <ce...@codesourcery.com> Thomas Schwinge <tho...@codesourcery.com> 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

[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 <ce...@codesourcery.com> Thomas Schwinge

[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-10 Cesar

[gomp4] add support for derived types in ACC UPDATE

2016-11-10 Thread Cesar Philippidis
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 <ce...@codesourcery.com> gcc/fortran/ * openmp.c (gfc_match_omp_variable_list

[openacc] add support for common block data

2016-11-07 Thread Cesar Philippidis
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 <ce...@codesourcery.com> gcc/fortran/

[gomp4] remove GOVD_USE_DEVPTR

2016-11-07 Thread Cesar Philippidis
remove GOVD_USE_DEVPTR from gomp4. Cesar 2016-11-07 Cesar Philippidis <ce...@codesourcery.com> 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.

[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 <ce...@codesourcery.com> libgomp/ Backport from trunk 2016-11-02 Cesar Philippidis <ce...@codesourcery.com> Nathan Sidwell <nat...@acm.org> * plugin/plugin-nvptx.c (nvptx_exec): Inte

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

2016-11-03 Thread Cesar Philippidis
| 2 + > .../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-v

[openacc] add warnings for unused parallelism

2016-11-03 Thread Cesar Philippidis
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 <ce...@codesourcery.com> Nathan

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
016-10-26 Cesar Philippidis <ce...@codesourcery.com> 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/n

[nvptx] propagating conditionals in worker-vector partitioned loops

2016-10-26 Thread Cesar Philippidis
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 <ce...@codesourcery.com> gcc/

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

2016-10-25 Thread Cesar Philippidis
hen 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 <ce...@codesourcery.com> gcc/fortran/ * intrinsic.texi (cosd): New mathop. diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 16

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

2016-10-05 Thread Cesar Philippidis
ile 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 <ce...@codesourcery.com> gcc/fortran/ * trans-openmp.c (gfc_trans_omp_d

[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 <ce...@codesourcery.com> gcc/fortran/ * openmp.c (resolve_omp_c

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

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

2016-10-03 Thread Cesar Philippidis
Cesar Philippidis <ce...@codesourcery.com> 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 3

[gomp4] update gfortran's tile clause error handling

2016-10-03 Thread Cesar Philippidis
to be 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. Cesar 2016-10-03 Cesar

[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 <ce...@codesou

[openacc] fix an ICE with acc declared VLAs

2016-09-22 Thread Cesar Philippidis
ther 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 trunk? Cesar 2016-09-22 Ce

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

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
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 <ce...@codesourcery.com> gcc/fortrann/ * openmp.c (gfc_match_omp_map_clause): Add new common_

[patch,gomp4] Fix PR74600

2016-09-09 Thread Cesar Philippidis
think about this solution? It would have to be modified for OpenMP targets though. Cesar 2016-09-09 Cesar Philippidis <ce...@codesourcery.com> PR fortran/74600 gcc/ * tree-nested.c (convert_nonlocal_reference_stmt): Create a private clause for the CHAIN stack

[gomp4] fix an ICE involving assumed-size arrays

2016-08-30 Thread Cesar Philippidis
. 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 <ce...@codesourcery.com> gcc/ * omp-low.c (lower_omp_target): Handle NULL-sized types for assumed

[patch] Fix PR72715

2016-08-29 Thread Cesar Philippidis
Cesar Philippidis <ce...@codesourcery.com> 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. * gfortran.dg

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

2016-08-26 Thread Cesar Philippidis
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 <ce...@codesourcery.com> gcc/fortran/ * gfortran.h (enum oacc_function)

[gomp4] adjust offsets for present data clauses

2016-08-23 Thread Cesar Philippidis
, 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 <ce...@codesourcery.com> libgomp/ * oacc-parallel.c (GOACC_parallel_keyed): Add offset to de

Re: Repeated use of the OpenACC routine directive

2016-08-19 Thread Cesar Philippidis
ning 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 <ce...@codesourcery.com> gcc/testsuite/ * gfortran.dg/goacc/routine-8.f90: New test. * gfortran.dg/goacc/rout

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/ > *

[patch,gomp4] fix pr70828

2016-08-17 Thread Cesar Philippidis
++. In the meantime, I'll apply this WIP patch to gomp-4_0-branch. Cesar 2016-08-17 Cesar Philippidis <ce...@codesourcery.com> 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

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

2016-08-15 Thread Cesar Philippidis
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 current procedure. This w

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

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

2016-08-11 Thread Cesar Philippidis
erability-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-branch. Cesar 2016-08-11 Cesar

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

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

2016-08-02 Thread Cesar Philippidis
to leave that as-is for now. Cesar 2016-08-02 Cesar Philippidis <ce...@codesourcery.com> 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 data clause validation. *

[gomp4] Fix PR72741

2016-07-28 Thread Cesar Philippidis
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 <ce...@codesourcery.com> PR fortran/72741 gcc/fortran/ * openmp.c (gfc_oacc_routine_dims): Move gfc_error to gfc_match_oacc_routine.

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 with the cal

[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 <ce...@codesourcery.com> gcc/fortran/ * gfortran.h (enum oacc_function): Define. (oacc_function_type): Declare. (symbol_attribute): Change th

Patch ping

2016-07-22 Thread Cesar Philippidis
The following patches still need to be reviewed: * Change an LTO wrapper assert failure to an error when it detects missing symbols. This situation can arise in offloading code, e.g. when the user forgets to declare a global variable as offloadable.

<    1   2   3   4   5   6   7   >