Re: [PATCH] update edge profile info in nvptx.c

2017-07-20 Thread Cesar Philippidis
On 07/20/2017 06:04 AM, Tom de Vries wrote: > On 07/13/2017 06:53 PM, Cesar Philippidis wrote: >> Similarly, for nvptx vector reductions, when it comes time to initialize >> the reduction variable, the nvptx BE constructs a branch so that only >> vector lanes 1 to vector_len

Re: [gomp4] OpenACC async re-work

2017-07-25 Thread Cesar Philippidis
On 07/25/2017 05:51 AM, Chung-Lin Tang wrote: > On 2017/6/29 6:31 AM, Cesar Philippidis wrote: > Attached is the updated version of the patch, re-tested. > > Thomas, do you need some more time to look over it? Or should I commit it > first? I'm not too concerned about

[og7] Fix libgomp.oacc-c/asyncwait-2.c

2017-08-01 Thread Cesar Philippidis
allow variables. Cesar 2017-08-01 Cesar Philippidis Thomas Schwinge gcc/ * omp-expand.c (expand_omp_target): Don't expect OMP_CLAUSE_WAIT_EXPR to be a constant expression. diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index 8301dcb0de5..bf1f127d8d6 100644 --- a/gcc/omp-exp

[og7] Adjust k80 resources

2017-08-11 Thread Cesar Philippidis
ce this failure, but it does show up in various OpenACC tests such as cloverleaf. I'll try to create a reduced test case that uses a lot of hardware registers later. Cesar 2017-08-11 Cesar Philippidis libgomp/ * plugin/cuda/cuda.h (CUdevice_attribute): Add CU_DEVICE_ATTRIBUTE_COMP

[og7] dynamic num_workers

2017-08-11 Thread Cesar Philippidis
rally improves usability because it doesn't require the end user to rebuild their program multiple times to find the optimal num_workers. That's because aforementioned GOMP_OPENACC_DIM environment variable can be used at run time. Cesar 2017-08-11 Cesar Philippidis gcc/ * confi

[gomp4] OpenACC update if_present runtime support

2017-05-09 Thread Cesar Philippidis
27;ve applied this patch to gomp-4_0-branch. Cesar 2017-05-09 Cesar Philippidis gcc/ * gimplify.c (gimplify_omp_target_update): Relax OpenACC update data mappings to GOMP_MAP_{TO,FROM} when the user specifies if_present. gcc/testsuite/ * c-c++-common/goacc/update-if_present-1.c: Update test

[gomp4] correct an implicit data clause bug

2017-05-11 Thread Cesar Philippidis
which leads to bogus data clauses and failures at run time. I've applied this patch to gomp-4_0-branch to fix that. Cesar 2017-05-11 Cesar Philippidis gcc/ * gimplify.c (gomp_needs_data_present): Ensure that the correct decl is matched when scanning clauses in the enclosing acc data

[gomp4] Handle parallel reductions explicitly initialized by the user

2017-05-12 Thread Cesar Philippidis
trunk? I'll hopefully start working on trunk again in a week or so. Cesar 2017-05-12 Cesar Philippidis gcc/ * config/nvptx/nvptx.c (nvptx_goacc_reduction_init): Don't update LHS if it doesn't exist. libgomp/ * testsuite/libgomp.oacc-c-c++-common/par-reduction-3.c: New test

[gomp4] Update libgomp documentation

2017-05-16 Thread Cesar Philippidis
ly impacts libgomp. And I was tempted to just to copy the complete texinfo.tex file from texinfo 6.3, like it was last done in 2012. However, I wasn't sure if that would have required any strange dependencies. I've applied this patch to gomp-4_0-branch. Cesar 2017-05-16 Cesar Philippidis

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

[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

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

[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

[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

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] 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: [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; >

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

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

[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] 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] 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] Don't mark OpenACC auto loops as independent inside acc parallel regions

2017-05-03 Thread Cesar Philippidis
n the loop accordingly. This patch, which I've applied to gomp-4_0-branch makes GCC comply with this new behavior. Cesar 2017-05-03 Cesar Philippidis gcc/ * omp-low.c (lower_oacc_head_mark): Don't mark OpenACC auto loops as independent inside acc parallel regions. gcc/testsuite/

[gomp4] Add front end support for the if_present clause with the update directive

2017-05-04 Thread Cesar Philippidis
with goacc.exp are built with -fopenacc, but for some reason the tests in g++.dg/goacc/ are still ran without -fopenacc for g++.dg/dg.exp. Maybe there's something wrong with g++.dg/goacc/goacc.exp handling of .C files? This patch has been committed to gomp-4_0-branch. Cesar 2017-05-04 Cesar P

[OpenACC] Enable SIMD vectorization on vector loops

2017-09-13 Thread Cesar Philippidis
tch OK for trunk? Cesar 2017-09-13 Cesar Philippidis gcc/ * omp-offload.c (oacc_xform_loop): Enable SIMD vectorization on non-SIMT targets in acc vector loops. diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c index 2d4fd411680..9d5b8bef649 100644 --- a/gcc/omp-offload.c +++ b/gcc/omp

[OpenACC] Add support for floating point type in GOMP_MAP_FIRSTPRIVATE_INT

2017-09-20 Thread Cesar Philippidis
before stage1 closes. Still, this patch does represent an incremental improvement by itself. Is this patch OK for trunk? Maybe a followup patch should enable floating point values GOMP_MAP_FIRSTPRIVATE_INT values in OpenMP. Cesar 2017-09-20 Cesar Philippidis gcc/ * omp-low.c

[OpenACC] Don't restrict ACC wait arguments to constants in fortran

2017-09-21 Thread Cesar Philippidis
emove this restriction. I'll backport this patch to og7 shortly. Cesar 2017-09-21 Cesar Philippidis gcc/fortran/ * openmp.c (gfc_match_oacc_wait): Don't restrict wait directive arguments to constant integers. gcc/testsuite/ * gfortran.dg/goacc/wait.f90: New test. diff --git a/gc

Re: [gomp4] OpenACC async re-work

2017-10-10 Thread Cesar Philippidis
On 10/10/2017 11:08 AM, Thomas Schwinge wrote: > Reported by Cesar for a test case similar to the one below, where we > observe: > > acc_prof-cuda-1.exe: [...]/libgomp/oacc-profiling.c:592: > goacc_profiling_dispatch_p: Assertion `thr->prof_info == NULL' failed. > > This is because of: > >

[og7] Allow the accelerator to have more offloaded functions than the host

2017-10-11 Thread Cesar Philippidis
umber of offloaded functions. As a temporary workaround, this patch teaches libgomp to allow the accelerator to possess more offloaded functions than the host. I've applied this patch to openacc-gcc-7-branch. Is it also suitable for trunk? Cesar 2017-10-11 Cesar Philippidis libgomp/

[og7] Enable fortran derived types in acc enter/exit data

2017-10-11 Thread Cesar Philippidis
appen in the near term. Cesar 2017-10-11 Cesar Philippidis gcc/fortran/ * openmp.c (match_acc): Add new argument derived_types. Propagate it to gfc_match_omp_clauses. (gfc_match_oacc_enter_data): Update call to match_acc. (gfc_match_oacc_exit_data): Likewise. gcc/testsuite/ * gfortran.dg/

[og7] Enable 0-length array data mappings for implicit data clauses

2017-10-11 Thread Cesar Philippidis
n another compiler which goes through the trouble of mapping the dynamic array to the accelerator automatically, but that's beyond the scope of this patch. Cesar 2017-10-11 Cesar Philippidis gcc/ * gimplify.c (oacc_default_clause): Create implicit 0-length array data clauses for point

[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: [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] 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

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

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

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] 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] 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:

[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

[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

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

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-&

[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

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

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] 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

[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

[openacc] combined loop errors

2016-03-09 Thread Cesar Philippidis
tains incomplete fields. So updating the split clauses allows the compiler to gracefully error. Is this patch ok for trunk? It's specific to openacc. Thanks, Cesar 2016-03-09 Cesar Philippidis gcc/c/ * c-parser.c (c_parser_oacc_loop): Update cclauses and clauses when calling c_finish_omp_clau

[PATCH] Fix PR7001

2016-03-10 Thread Cesar Philippidis
This patch updates a libgomp test case which was expecting char to be signed when that's not guaranteed to be the case. Jakub pre-approved this patch in the PR. I'll apply this patch to trunk and backport it to gomp-4_0-branch shortly. Cesar 2016-03-10 Cesar Philippidis li

[gomp4] various backports from trunk

2016-03-11 Thread Cesar Philippidis
I've applied this patch which backports my recent trunk changes to gomp-4_0-branch. Specifically, this patch contains * nvptx vector state propagation fix, which includes the updated test fix for pr70009 * combined loop clauses fix Cesar 2016-03-11 Cesar Philippidis gcc/c/

[patch] Fortran fix for PR70289

2016-04-01 Thread Cesar Philippidis
riables which haven't been properly declared. Cesar 2016-03-31 Cesar Philippidis gcc/fortran/ * openmp.c (resolve_oacc_private_reductions): New function. (resolve_omp_clauses): Ensure that acc parallel reductions have a copy, pcopy or present clause associated with it, otherwise emit a

Re: [patch] Fortran fix for PR70289

2016-04-01 Thread Cesar Philippidis
On 04/01/2016 07:56 AM, Jakub Jelinek wrote: > On Fri, Apr 01, 2016 at 07:49:16AM -0700, Cesar Philippidis wrote: >> The bug in PR70289 is an assertion failure triggered by a static >> variable used inside an offloaded acc region which doesn't have a data >> clause ass

Re: [patch] Fortran fix for PR70289

2016-04-04 Thread Cesar Philippidis
On 04/01/2016 08:17 AM, Jakub Jelinek wrote: > On Fri, Apr 01, 2016 at 08:07:24AM -0700, Cesar Philippidis wrote: >> On 04/01/2016 07:56 AM, Jakub Jelinek wrote: >>> On Fri, Apr 01, 2016 at 07:49:16AM -0700, Cesar Philippidis wrote: >>>> The bug in PR70289 is an as

Re: openacc reference reductions

2016-04-05 Thread Cesar Philippidis
On 02/22/2016 07:34 AM, Cesar Philippidis wrote: > Ping. This patch still needs a review. Ping. I've attached a rebased version of this patch. The omp-low.c bits haven't changed, but the test cases have since Thomas has been merging some of them from trunk. I separated the omp-

Re: openacc reference reductions

2016-04-06 Thread Cesar Philippidis
On 04/06/2016 07:23 AM, Jakub Jelinek wrote: > On Tue, Apr 05, 2016 at 06:53:47PM -0700, Cesar Philippidis wrote: >> --- a/gcc/omp-low.c >> +++ b/gcc/omp-low.c >> @@ -309,6 +309,25 @@ is_oacc_kernels (omp_context *ctx) >>== GF_OMP_TARGET_KIND_OACC_KERNELS)

Re: openacc reference reductions

2016-04-07 Thread Cesar Philippidis
not, and then you can add the extra implicit clause and set > OMP_CLAUSE_MAP_IN_REDUCTION on it as appropriate. This new patch does that now. Is this patch OK for trunk? Cesar 2016-04-07 Cesar Philippidis PR lto/70289 PR ipa/70348 PR tree-optimization/70373 PR middle-end/70533 PR

Re: openacc reference reductions

2016-04-08 Thread Cesar Philippidis
On 04/08/2016 12:40 AM, Jakub Jelinek wrote: > On Thu, Apr 07, 2016 at 09:34:43PM -0700, Cesar Philippidis wrote: >> --- a/gcc/gimplify.c >> +++ b/gcc/gimplify.c >> @@ -5802,7 +5802,8 @@ omp_add_variable (struct gimplify_omp_ctx *ctx, tree >> decl, unsigned int flags)

Re: openacc reference reductions

2016-04-08 Thread Cesar Philippidis
On 04/08/2016 07:14 AM, Nathan Sidwell wrote: > On 04/08/16 00:40, Jakub Jelinek wrote: > >>> +/* OpenACC parallel reductions need a present_or_copy clause to ensure >>> + that the original variable used in the reduction gets updated on >>> + the host. Scan the list of clauses for reduction s

[gomp4] backport parallel reduction changes

2016-04-11 Thread Cesar Philippidis
o late for trunk right now. I'll take a closer look at them later, but maybe we should drop them in gomp-4_0-branch. I've applied this patch to gomp-4_0-branch. Cesar 2016-04-08 Cesar Philippidis gcc/ PR tree-optimization/70357 * gimplify.c (gimplify_scan_omp_clauses): Remove stale

[patch] fix an openacc reduction test for PR68242

2016-04-13 Thread Cesar Philippidis
usted reduction-1.c because it can also overflow. This patch has been tested on i686-linux and x86_64-linux. I'll apply this patch to trunk as obvious shortly. Cesar 2016-04-13 Cesar Philippidis libgomp/ PR testsuite/68242 * testsuite/libgomp.oacc-c-c++-common/reduction-1.c: A

[patch] fix an openacc reference-type reduction bug in PR70643

2016-04-13 Thread Cesar Philippidis
s can be non-integral constants. This patch fixes that problem and adds a new runtime test case. Is this patch ok for trunk? I tested it on x86_64-linux. Cesar 2016-04-13 Cesar Philippidis gcc/ * omp-low.c (lower_oacc_reductions): Check for TREE_CONSTANT when building a mem ref for the inc

[patch] fix an openacc test case

2016-04-14 Thread Cesar Philippidis
terminates. This problem only occurs on nvptx targets. I'll apply this patch to trunk as obvious. Cesar 2016-04-14 Cesar Philippidis libgomp/ * testsuite/libgomp.oacc-fortran/non-scalar-data.f90: Don't pass parameter variables to subroutines. diff --git a/libgomp/testsuite/libg

[patch] update handling of 'acc parallel loop' reductions for PR70626

2016-04-15 Thread Cesar Philippidis
I fix PR70626, I re-enable that test coverage. Is this patch ok for gcc-6 and trunk? I bootstrapped and regression tested on x86_64-none-linux-gnu. Cesar 2016-04-15 Cesar Philippidis gcc/c-family/ PR middle-end/70626 * c-common.h (c_oacc_split_loop_clauses): Add boolean argument. * c-omp.c

[patch] fix openacc data clause errors in c/c++ for PR70688

2016-04-22 Thread Cesar Philippidis
_oacc, but I went with that because it seems like the thing to do here. Maybe it would be better if all of those arguments were consolidated into a single bitmask or enum? Is this OK for trunk and possibly gcc-6.2? Cesar 2016-04-21 Cesar Philippidis gcc/c/ PR c/70688 *

[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

[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

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])

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

[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

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

[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] 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..

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] 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

[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

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

[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

[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

[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

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] 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: [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 + > ..

[PATCH] error on missing LTO symbols

2016-07-01 Thread Cesar Philippidis
This patch was originally posted last year: <https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02076.html>. I was trying to avoid it for OpenACC, but making non-acc routine calls errors would complicate library functions. Cesar 2016-07-01 Cesar Philippidis gcc/ * lto-cgraph.c (input_overwri

[gomp4] backport fortran FE error handling changes

2016-07-01 Thread Cesar Philippidis
I've applied this patch to gomp-4_0-branch which backports the recent error handling changes I made to the fortran FE. The discussion for the original patch for trunk can be found in this thread <https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00474.html>. 2016-07-01 Cesar Philippidis

[PATCH] OpenACC routines in fortran modules

2016-07-01 Thread Cesar Philippidis
add acc routine support for intrinsic procedures. So I can drop that part of the patch if necessary. Cesar 2016-07-01 Cesar Philippidis gcc/fortran/ * gfortran.h (enum oacc_function): Define. (oacc_function_type): Declare. (symbol_attribute): Change the type of oacc_function from unsigned to a

Re: [committed] Fix OpenMP parsing of the specification part in functions (PR fortran/71704)

2016-07-08 Thread Cesar Philippidis
On 06/30/2016 10:47 AM, Jakub Jelinek wrote: > The Fortran parser apparently relies in functions that have still undecided > kind of the result that ST_GET_FCN_CHARACTERISTICS artificial statement is > returned before any executable statements in the function. > In normal statements that is ensure

Re: [committed] Fix OpenMP parsing of the specification part in functions (PR fortran/71704)

2016-07-08 Thread Cesar Philippidis
On 07/08/2016 09:18 AM, Jakub Jelinek wrote: > On Fri, Jul 08, 2016 at 09:13:50AM -0700, Cesar Philippidis wrote: >> On 06/30/2016 10:47 AM, Jakub Jelinek wrote: >> >>> The Fortran parser apparently relies in functions that have still undecided >

Re: [committed] Fix OpenMP parsing of the specification part in functions (PR fortran/71704)

2016-07-08 Thread Cesar Philippidis
On 07/08/2016 09:31 AM, Jakub Jelinek wrote: > On Fri, Jul 08, 2016 at 09:19:01AM -0700, Cesar Philippidis wrote: >> 2016-07-08 Cesar Philippidis >> >> gcc/fortran/ >> * parse.c (matcha): Define. >> (decode_oacc_directive): Add spec_only local va

Re: [committed] Fix OpenMP parsing of the specification part in functions (PR fortran/71704)

2016-07-08 Thread Cesar Philippidis
On 07/08/2016 10:25 AM, Jakub Jelinek wrote: > On Fri, Jul 08, 2016 at 09:58:57AM -0700, Cesar Philippidis wrote: >>>> +#define matcha(keyword, subr, st) \ >>>> +do { \ >>>> +

[gomp4] backport fixes for PR71704

2016-07-12 Thread Cesar Philippidis
This patch contains both Jakub's OpenMP and my OpenACC fixes for PR71704. For reference, the discussion for the original patches can be found here <https://gcc.gnu.org/ml/gcc-patches/2016-06/msg02084.html>. I'll apply this patch to gomp-4_0-branch shortly. Cesar 2016-07-12 C

[PATCH] Remove struct map from plugin-nvptx

2016-07-12 Thread Cesar Philippidis
the original patch <https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01658.html>. Is this OK for trunk? Cesar 2016-07-12 Cesar Philippidis James Norris libgomp/ * plugin/plugin-nvptx.c (struct map): Delete. (map_pop): Remove use of struct map. (map_push): Likewise. Remove async argument

Re: [PATCH] zero-length arrays in OpenACC

2016-07-14 Thread Cesar Philippidis
Ping, x2. Cesar On 06/01/2016 02:35 PM, Cesar Philippidis wrote: > This patch teaches c and c++ front ends and omp-low how to deal with > subarray involving GOMP_MAP_FORCE_{PRESENT,TO,FROM,TOFROM} data > mappings. As the libgomp test case shows, it might be possible for a > subarray

<    1   2   3   4   5   6   7   >