[PATCH] Fix OpenACC vector_length parsing in fortran

2016-07-14 Thread Cesar Philippidis
Cesar 2016-07-14 Cesar Philippidis gcc/fortran/ * openmp.c (gfc_match_omp_clauses): Scan for clause vector_length before vector. gcc/testsuite/ * gfortran.dg/goacc/vector_length.f90: New test. diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c index 865e0d9..b70ff3e 100644 --

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. https://gcc.gnu.org/ml/gcc-patches/2016-0

[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

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

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

[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

[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

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

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

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

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

[patch] cleanup *finish_omp_clauses

2016-04-27 Thread Cesar Philippidis
special handling in *finish_omp_clauses in the near future, too, so rather than add an is_oacc argument, I introduced an enum c_omp_region_type, similar to the one in gimplify.c. Is this patch ok for trunk? I'll make use of C_ORT_ACC shortly in a follow up patch. Cesar 2016-04-27

Re: [patch] cleanup *finish_omp_clauses

2016-04-28 Thread Cesar Philippidis
On 04/28/2016 01:56 AM, Jakub Jelinek wrote: > On Wed, Apr 27, 2016 at 07:37:17PM -0700, Cesar Philippidis wrote: >> This patch replaces all of the bool argument to c_finish_omp_clauses and >> finish_omp_clauses in the c and c++ front ends, respectively. Right now >> there are

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

2016-04-28 Thread Cesar Philippidis
Ping. Cesar On 04/15/2016 02:30 PM, Cesar Philippidis wrote: > This patch makes the c, c++ and fortran FEs duplicate the reduction > clauses in a combined 'acc parallel loop' directive when it splits that > directive into separate parallel and loop directives. So giv

Re: [patch] cleanup *finish_omp_clauses

2016-05-01 Thread Cesar Philippidis
s passing C_ORT_OMP instead of C_ORT_OMP_DECLARE_SIMD. I didn't look into this too deeply though. Is this patch OK for trunk? Cesar 2016-04-29 Cesar Philippidis gcc/c-family/ * c-common.h (enum c_omp_region_type): Define. gcc/c/ * c-parser.c (c_parser_oacc_all_clauses): Update call to c_finish_omp_

[gomp4] backport fix for PR69363

2016-05-09 Thread Cesar Philippidis
I've applied this patch to gomp-4_0-branch which backports some cilk changes in the c and c++ front ends to gomp-4_0-branch. These changes were necessary for my recent finish_omp_clauses patch, which I'll be committing next. Cesar 2016-05-09 Cesar Philippidis Backport trunk r235290

[gomp4] backport the *finish_omp_clauses changes

2016-05-09 Thread Cesar Philippidis
Cesar 2016-05-09 Cesar Philippidis Backport trunk r235780: 2016-05-02 Cesar Philippidis gcc/c-family/ * c-common.h (enum c_omp_region_type): Define. gcc/c/ * c-parser.c (c_parser_oacc_all_clauses): Update call to c_finish_omp_clauses. (c_parser_omp_all_clauses): Lik

[gomp4] backport fix for PR70626

2016-05-09 Thread Cesar Philippidis
-reduction.C is broken in gomp4, so I had to xfail it. Apparently, it exposed an async bug. My forthcoming patch which uses firstprivate pointers for subarrays should fix it. This patch has been committed to gomp-4_0-branch. Cesar 2016-05-09 Cesar Philippidis Backport trunk r235651: 20

[patch,openacc] use firstprivate pointers for subarrays in c and c++

2016-05-10 Thread Cesar Philippidis
not that exhaustive though, but I did include a test case for OpenMP. It should be noted that I still need to update the behavior of subarray pointers in fortran. I'm just waiting until for the OpenMP 4.5 fortran changes to land in trunk first. Is this patch OK for trunk? Cesar 2016-05-10

inhibit the sincos optimization when the target has sin and cos instructions

2016-05-13 Thread Cesar Philippidis
incos pass to ignore sin, cos and cexpi instructions when the target can expand those calls. This yields a 6x speedup in 314.omriq from spec accel when running on Nvidia accelerators. Is this OK for trunk? Cesar 2016-05-13 Cesar Philippidis gcc/ * tree-ssa-math-opts.c (pass_cse_sincos::ex

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-17 Thread Cesar Philippidis
On 05/13/2016 01:13 PM, Andrew Pinski wrote: > On Fri, May 13, 2016 at 12:58 PM, Richard Biener > wrote: >> On May 13, 2016 9:18:57 PM GMT+02:00, Cesar Philippidis >> wrote: >>> The cse_sincos pass tries to optimize sequences such as >>> >>> sin (x)

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-17 Thread Cesar Philippidis
On 05/17/2016 02:22 PM, Andrew Pinski wrote: > On Tue, May 17, 2016 at 2:10 PM, Cesar Philippidis > wrote: >> On 05/13/2016 01:13 PM, Andrew Pinski wrote: >>> On Fri, May 13, 2016 at 12:58 PM, Richard Biener >>> wrote: >>>> On May 13, 2016 9:18:57 PM

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-18 Thread Cesar Philippidis
On 05/18/2016 05:29 AM, Nathan Sidwell wrote: > On 05/17/16 17:30, Cesar Philippidis wrote: >> On 05/17/2016 02:22 PM, Andrew Pinski wrote: >>>> gcc.sum >>>> Tests that now fail, but worked before: >>>> >>>> nvptx-none-run: gcc.c-torture/e

Re: inhibit the sincos optimization when the target has sin and cos instructions

2016-05-19 Thread Cesar Philippidis
On 05/19/2016 04:29 AM, Alexander Monakov wrote: > On Wed, 18 May 2016, Cesar Philippidis wrote: > Note that the documentation suggests using 'make_safe_from' to concisely > express conflict resolution: > >> diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvp

Re: [ping][patch,openacc] use firstprivate pointers for subarrays in c and c++

2016-05-19 Thread Cesar Philippidis
Ping. Cesar On 05/10/2016 01:29 PM, Cesar Philippidis wrote: > Pointers are special in OpenACC. Depending on the context, they can > either be treated as a "scalar" or as special firstprivate pointer. This > is in contrast to OpenMP target pointers, which are always treate

[gomp4] backport the new sincos pattern

2016-05-23 Thread Cesar Philippidis
I've committed this patch to backport the new sincos pattern, which is enabled with -ffast-math, to gomp-4_0-branch. Cesar 2016-05-23 Cesar Philippidis gcc/ * config/nvptx/nvptx.md (sincossf3): New pattern. gcc/testsuite/ * gcc.target/nvptx/sincos.c: New test. diff --git a/gcc/c

Re: [patch,openacc] use firstprivate pointers for subarrays in c and c++

2016-05-23 Thread Cesar Philippidis
On 05/20/2016 02:42 AM, Jakub Jelinek wrote: > On Tue, May 10, 2016 at 01:29:50PM -0700, Cesar Philippidis wrote: >> @@ -5796,12 +5796,14 @@ tree >> finish_omp_clauses (tree clauses, enum c_omp_region_type ort) >> { >>bitmap_head generic_head, firstpri

[gomp4] non-acc loop reductions implicit copy bugfix

2015-08-14 Thread Cesar Philippidis
er to correct this behavior in the gimplifier later on if necessary. I'll apply this patch to gomp-4_0-branch shortly. Cesar 2015-08-14 Cesar Philippidis gcc/ * c/c-typeck.c (c_finish_omp_clauses): Permit variables to appear in both OpenACC data and reduction clauses. * cp/semantics

[gomp4] New reduction infrastructure for OpenACC

2015-08-19 Thread Cesar Philippidis
for the existing OpenMP reductions. Rather, OpenMP will continue to use lower_reduction_clauses and friends, while OpenACC will use this infrastructure. That said, OpenMP could taught to use this infrastructure. Is this patch OK for gomp-4_0-branch? Thanks, Cesar 2015-08-19 Cesar Philippidis g

[gomp4] nvptx reductions

2015-08-21 Thread Cesar Philippidis
ch after the infrastructure patch goes in? Cesar 2015-08-20 Cesar Philippidis gcc/ * config/nvptx/nvptx.c (enum nvptx_builtins): New enum. (NVPTX_BUILTIN_MAX): Delete. (nvptx_get_worker_red_addr_fn): New function. (nvptx_generate_vector_shuffle): New function. (nvptx_shuffle_reduction): Ne

[gomp4] don't use VLA's in the reduction tests

2015-08-21 Thread Cesar Philippidis
Nathan noticed that I was using VLA's in the a couple of compile-time reduction tests. That's bad because ptx doesn't have support alloca. I guess these tests used to pass because we were only running them on the host. I'll apply this patch shortly. Cesar 2015-08-21 Cesar

[gomp4] lowering OpenACC reductions

2015-08-21 Thread Cesar Philippidis
es concern me about this change is that par-loops will need to become aware of that in insert those calls as necessary. Technically, it should be ok for now because par-loops doesn't support workers and vectors yet. But if we go with this change, par-loops will need to be updated event

[gomp4] firstprivate bug in combined acc loops

2015-08-24 Thread Cesar Philippidis
h has been committed to gomp-4_0-branch. Cesar 2015-08-24 Cesar Philippidis gcc/c-family * c-omp.c (c_oacc_split_loop_clauses): Don't propagate OMP_CLAUSE_FIRSTPRIVATE to acc loops with splitting the clauses. diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c index e9df829..79817

[gomp4] bug fix for num_gangs inside fortran subroutines

2015-08-24 Thread Cesar Philippidis
This patch adds support for num_gangs, num_workers and vector_length inside nested functions. This fixes an ICE that I hit inside a nested fortran subroutine that was using a num_gangs clause on an acc parallel construct. I applied this patch to gomp-4_0-branch. Cesar

[gomp4] teach the tracer pass to ignore more blocks for OpenACC

2015-08-26 Thread Cesar Philippidis
nicely with const_basic_block. Is this patch ok for gomp-4_0-branch? Cesar 2015-08-25 Cesar Philippidis gcc/ * tracer.c (ignore_bb_p): Change bb argument from const_basic_block to basic_block. Check for non-clonable calls to internal functions. diff --git a/gcc/tracer.c b/gcc/tracer.c

Re: [gomp4] lowering OpenACC reductions

2015-08-26 Thread Cesar Philippidis
On 08/21/2015 02:00 PM, Cesar Philippidis wrote: > This patch teaches omplower how to utilize the new OpenACC reduction > framework described in Nathan's document, which was posted here > <https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01248.html>. Here is the > infras

[gomp4] initialize worker reduction locks

2015-08-26 Thread Cesar Philippidis
e internal function used in the patch a couple of days ago. I've applied this patch to gomp-4_0-branch. Cesar 2015-08-26 Cesar Philippidis gcc/ * omp-low.c (lower_oacc_reductions): Call GOACC_REDUCTION_INIT to initialize the gang and worker mutex. diff --git a/gcc/omp-low.c b/gcc/omp-low.

[gomp4, wip] remove references to ganglocal shared memory inside gcc

2015-08-26 Thread Cesar Philippidis
to do here? Cesar 2015-08-26 Cesar Philippidis gcc/ * builtins.c (expand_oacc_ganglocal_ptr): Delete. (expand_builtin): Remove stale GOACC_GET_GANGLOCAL_PTR builtin. * config/nvptx/nvptx.md (ganglocal_ptr): Delete. * gimple.h (struct gimple_statement_omp_parallel_layout): Remove gang

Re: [gomp4, wip] remove references to ganglocal shared memory inside gcc

2015-08-27 Thread Cesar Philippidis
On 08/27/2015 06:13 AM, Nathan Sidwell wrote: > On 08/26/15 21:37, Cesar Philippidis wrote: >> This patch strips out all of the references to ganglocal memory in gcc. >> Unfortunately, the runtime api still takes a shared memory parameter, so >> I haven't made any cha

[gomp4] check for compatible parallelism with acc routines

2015-08-28 Thread Cesar Philippidis
itting both of these loops. I.e., only the seq loop itself is executing in a non-partitioned mode. Julian inquired about this in the openacc technical list a while ago, but I don't think he got a response. This patch has been applied to gomp-4_0-branch. Cesar 2015-08-28 Cesar Philippi

[gomp4] useless reduction locks and other bug fixes

2015-09-01 Thread Cesar Philippidis
This patch teaches lower_oacc_reductions not to generate calls to GOACC_{UN}LOCK if they aren't any reductions. That situation can happen when there is a fake gang reduction on a private variable. I also found a bug where the lower_rec_input_clauses expects there to be a data mapping for the reduc

Re: [gomp4] useless reduction locks and other bug fixes

2015-09-01 Thread Cesar Philippidis
[Attaching patch this time.] On 09/01/2015 04:21 PM, Cesar Philippidis wrote: > This patch teaches lower_oacc_reductions not to generate calls to > GOACC_{UN}LOCK if they aren't any reductions. That situation can happen > when there is a fake gang reduction on a private variabl

[gomp4] remove xfails in the libgomp reduction tests

2015-09-02 Thread Cesar Philippidis
that bug and removes the xfails from the reduction test cases. This patch has been committed to gomp-4_0-branch. Cesar 2015-09-02 Cesar Philippidis libgomp/ * testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv-np-2.c: Remove xfail. * testsuite/libgomp.oacc-c-c++-common/loop-reduction-gwv

[gomp4] force global locks for nvptx targets

2015-09-08 Thread Cesar Philippidis
t for the time being, global locks appear to work albeit with a lock contention penalty. I've applied this patch to gomp-4_0-branch. Cesar 2015-09-08 Cesar Philippidis gcc/ * config/nvptx/nvptx.c (force_global_lock): New global variable. (nvptx_expand_oacc_lock): Use it to workaroun

[gomp4] assign unused gwv clauses to auto/independent parallel acc loops

2015-09-09 Thread Cesar Philippidis
ation gets resolved? Cesar 2015-09-09 Cesar Philippidis gcc/ * omp-low.c (struct oacc_gwv): New struct. (filter_omp_clause): New function. (set_oacc_parallel_loop_gwv_1): New function. (set_oacc_parallel_loop_gwv): New function. (scan_omp_for): Use filer_omp_clause to remove the stale

[gomp4] parallel reduction nested inside data regions

2015-09-11 Thread Cesar Philippidis
gomp-4_0-branch. Cesar 2015-09-11 Cesar Philippidis gcc/ * omp-low.c (build_outer_var_ref): gcc/testsuite/ * c-c++-common/goacc/parallel-reduction.c: Enclose the parallel reduction inside an acc data region. libgomp/ * testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c: Enclose

[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

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

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

[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

[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

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

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

[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

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

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

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 -- 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 -- 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 -- 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: [gomp4] [WIP] OpenACC bind, nohost clauses

2015-12-14 Thread Cesar Philippidis
On 12/08/2015 11:55 AM, Thomas Schwinge wrote: Just for clarification, we're implementing the bind clause with the semantics defined in OpenACC 2.5, correct? The 2.0a semantics aren't clear. > On Sat, 14 Nov 2015 09:36:36 +0100, I wrote: >> Initial support for the OpenACC bind and nohost clauses

Re: [gomp4] [WIP] OpenACC bind, nohost clauses

2015-12-16 Thread Cesar Philippidis
On 12/14/2015 12:36 PM, Cesar Philippidis wrote: > On 12/08/2015 11:55 AM, Thomas Schwinge wrote: >> On Sat, 14 Nov 2015 09:36:36 +0100, I wrote: >> C front end: >> >> --- gcc/c/c-parser.c >> +++ gcc/c/c-parser.c >> @@ -11607,6 +11607,8 @@ c_par

Re: [gomp4] kernels offload fns

2016-01-06 Thread Cesar Philippidis
> + int level = oacc_fn_attrib_level (attrs); dims is dead and that's causing a bootstrap failure. I've applied this patch to gomp-4_0-branch to fix it. Cesar 2016-01-06 Cesar Philippidis gcc/ * omp-low.c (new_oacc_loop_routine): Remove stale dims variable. diff --git a/gcc/omp

[gomp4] private reductions

2016-01-06 Thread Cesar Philippidis
g++.sum:c-c++-common/goacc/routine-7.c libgomp.oacc-c/../libgomp.oacc-c-c++-common/declare-4.c I'll work on routine-7.c tomorrow. Jim, can you look at the declare-4.c failure? This patch has been applied to gomp-4_0-branch. Cesar 2016-01-06 Cesar Philippidis

[gomp4] reductions on explicitly private variables

2016-01-07 Thread Cesar Philippidis
t; 100; i++) v++; red[j] = v; } } This used to case a problem in lower_oacc_reductions because the reduction finalizer wasn't updating the correct variable. The attached patch fixes it. I've applied this patch to gomp-4_0-branch. Cesar 2016-01-07 Cesar Phi

[gomp4] teach the lto driver to error for missing decls

2016-01-08 Thread Cesar Philippidis
In openacc there are situations where a user may fail to mark a variable or function as offloadable (either using declare or routine). This patch makes the lto wrapper reduce the missing decl assertion to an error. I've applied this patch to gomp-4_0-branch. Cesar 2016-01-08 Cesar Philip

Re: [gomp4] private reductions

2016-01-08 Thread Cesar Philippidis
On 01/06/2016 07:55 PM, Cesar Philippidis wrote: > @@ -1384,26 +1331,9 @@ build_outer_var_ref (tree var, omp_context *ctx, bool > lastprivate = false) > x = build_simple_mem_ref (x); > } > } > - else if (is_oacc_parallel (ctx)) > -x = var; >

Re: [gomp4] private reductions

2016-01-11 Thread Cesar Philippidis
On 01/11/2016 04:10 AM, Thomas Schwinge wrote: > On Wed, 6 Jan 2016 19:55:02 -0800, Cesar Philippidis > wrote: >> This patch updates the way that private reductions are handled in gomp4 >> to be more like trunk. > > Anything to commit to trunk (test cases at least?)?

Re: [gomp4] teach the lto driver to error for missing decls

2016-01-11 Thread Cesar Philippidis
On 01/11/2016 07:34 AM, Bernd Schmidt wrote: > On 01/08/2016 11:37 PM, Cesar Philippidis wrote: >> In openacc there are situations where a user may fail to mark a variable >> or function as offloadable (either using declare or routine). This patch >> makes the lto wrapper re

[gomp4] arrays inside modules

2016-01-12 Thread Cesar Philippidis
n gomp4 in an attempt to move all of the non-array descriptor array variables into the offloaded region. Applications, such as cloverleaf, sometimes have a lot of small offloaded regions, and treating those supplementary array variables as firstprivate caused a measurable I/O overhead. Cesar 2015

[openacc] implicit non-scalars data mapping in kernels

2016-01-13 Thread Cesar Philippidis
ticed that there was already code in place to handle pointer types for parallel data mappings, so in this patch I moved that type extraction earlier so that both kernels and parallel regions can use it. Is this patch ok for trunk? Thanks, Cesar 2016-01-13 Cesar Philippidis gcc/ *

Re: [openacc] implicit non-scalars data mapping in kernels

2016-01-13 Thread Cesar Philippidis
On 01/13/2016 02:35 PM, Marek Polacek wrote: > On Wed, Jan 13, 2016 at 02:29:21PM -0800, Cesar Philippidis wrote: >> --- a/gcc/gimplify.c >> +++ b/gcc/gimplify.c >> @@ -5994,6 +5994,11 @@ oacc_default_clause (struct gimplify_omp_ctx *ctx, >> tree decl, unsigned fl

Re: [openacc] implicit non-scalars data mapping in kernels

2016-01-14 Thread Cesar Philippidis
On 01/14/2016 06:18 AM, Nathan Sidwell wrote: > On 01/13/16 17:44, Jakub Jelinek wrote: >> On Wed, Jan 13, 2016 at 11:35:08PM +0100, Marek Polacek wrote: >>> On Wed, Jan 13, 2016 at 02:29:21PM -0800, Cesar Philippidis wrote: >>>> --- a/gcc/gimplify.c >>>

[gomp4] implicit non-scalars data mapping in kernels backport

2016-01-15 Thread Cesar Philippidis
-patches/2016-01/msg00873.html>. Cesar 2016-01-15 Cesar Philippidis gcc/ * gimplify.c (oacc_default_clause): Decode reference and pointer types for both kernels and parallel regions. libgomp/ * testsuite/libgomp.oacc-fortran/kernels-data.f90: New test. diff --git a/gcc/gimpl

[PATCH] libgomp testsuite fixes

2013-05-30 Thread Cesar Philippidis
-fuse-linker-plugin}}" does not exist. This problem usually does not occur since the default site.exp does not contain ENABLE_LTO=1. I tested both with and without our custom site.exp. Is it OK for trunk? If so, please check it in since I do not have commit rights. Cesar Philippidis 2013-0

[PATCH] libitm testsuite fixes

2013-05-30 Thread Cesar Philippidis
lugin}}" does not exist. This problem usually does not occur since the default site.exp does not contain ENABLE_LTO=1. This patch has been tested both with and without our custom site.exp. Is this OK for trunk? If so, please check it in since I do not have commit rights. Cesar Philippidis 2013-0

[PATCH] libffi documentation fix

2013-06-03 Thread Cesar Philippidis
This patch from libffi revision 675c9839224 allows libffi.pdf to be generated without tex related errors. I tested it on gcc trunk. Please backport it to gcc. The original patch can be found here: http://sourceware.org/ml/libffi-discuss/2013/msg00086.html Cesar 2013-06-03 Andreas Schwab

[PATCH] ARMv6-M MI thunk fix

2013-06-06 Thread Cesar Philippidis
multiple inheritance, and that triggered the problem. I tested this patch with the default ARM and THUMB multilibs in additional to -march=armv6-m. OK for trunk? Cesar 2013-06-06 Julian Brown Cesar Philippidis gcc/ * config/arm/arm.c (arm_output_mi_thunk): Fix

Re: [PATCH] ARMv6-M MI thunk fix

2013-06-07 Thread Cesar Philippidis
argets. Is the new comment OK? If so, please check it in since I do not have SVN write access. Thanks, Cesar 2013-06-07 Julian Brown Cesar Philippidis gcc/ * config/arm/arm.c (arm_output_mi_thunk): Fix offset for TARGET_THUMB1_ONLY. Index: gcc/confi

Re: [PATCH] ARMv6-M MI thunk fix

2013-06-10 Thread Cesar Philippidis
On 6/10/13 8:32 AM, Richard Earnshaw wrote: > On 07/06/13 17:50, Cesar Philippidis wrote: >> On 6/6/13 9:00 AM, Richard Earnshaw wrote: >>> The pipeline offset is 4 for Thumb2 as well. So at the very least you >>> need to explain why your change doesn't apply then

Re: [patch,gomp4] make fortran loop variables implicitly private in openacc

2014-09-08 Thread Cesar Philippidis
On 09/07/2014 11:26 PM, Tobias Burnus wrote: > sorry for the slow review. No problem. I've been focusing on the subroutine clause lately. > On 22 August 2014 17:08, Cesar Philippidis wrote: >>> In OpenMP, one has (OMP 4.0, 2.14.3): "A list item that specifies a >>

[gomp4] OpenACC routine directive

2014-09-15 Thread Cesar Philippidis
that fortran lacks a file scope, so 'acc routine' wouldn't be visible to fact. Is this patch OK for gomp-4_0-branch? Thanks, Cesar 2014-09-15 Cesar Philippidis gcc/c-family/ * c-pragma.c (oacc_pragmas): Add the "routine" pragma. * c-pragma.h (pragma_

[gomp4] various OpenACC/PTX built-ins and a reduction tweak

2014-09-16 Thread Cesar Philippidis
ause recently. Is this OK for gomp-4_0-branch? Thanks, Cesar 2014-09-16 Cesar Philippidis gcc/ * builtins.c (expand_builtin_acc_on_device): New function. (expand_oacc_builtin): New function. (expand_builtin): Handle BUILT_IN_GOACC_NCTAID, BUILT_IN_GOACC_CTAID, BUILT_IN_

Re: [gomp4] various OpenACC/PTX built-ins and a reduction tweak

2014-09-17 Thread Cesar Philippidis
On 09/17/2014 01:49 AM, Jakub Jelinek wrote: > On Wed, Sep 17, 2014 at 10:44:12AM +0200, Tobias Burnus wrote: >> Cesar Philippidis wrote: >>> The patch introduces the following OpenACC/PTX-specific built-ins: >> ... >> >> It is not completely clear how they

Re: [gomp4] various OpenACC/PTX built-ins and a reduction tweak

2014-09-18 Thread Cesar Philippidis
On 09/18/2014 11:43 AM, Thomas Schwinge wrote: > Hi Cesar! > > On Tue, 16 Sep 2014 17:32:54 -0700, Cesar Philippidis > wrote: >> The patch introduces the following OpenACC/PTX-specific built-ins: >> >> * GOACC_ntid >> * GOACC_tid >> * GOACC_ncta

[gomp4] OpenACC wait directive

2014-09-23 Thread Cesar Philippidis
gomp-4_0-branch? Note that this patch doesn't actually implement the async or wait clause in the middle end yet, because that requires additional runtime support. Thanks, Cesar 2014-09-23 Cesar Philippidis gcc/fortran/ * openmp.c (OACC_WAIT_CLAUSES): New mask. (gfc_match_oacc_wait): U

Re: [gomp4] OpenACC wait directive

2014-10-03 Thread Cesar Philippidis
On 09/24/2014 12:18 AM, Ilmir Usmanov wrote: > Hi Cesar! > > Thank you for the patch! > > On 24.09.2014 02:29, Cesar Philippidis wrote: >> This patch adds support for the async clause in the wait directive in >> fortran. It should be pretty straight forward. The for

[gomp4] reduction bug fix

2014-10-03 Thread Cesar Philippidis
ome typos in the original comment, so I took the opportunity to fix them, I hope. Is this OK for gomp-4_0-branch? Thanks, Cesar 2014-10-02 Cesar Philippidis gcc/ * omp-low.c (lower_reduction_clauses): Clarify comment. (process_reduction_data): Scan for nonempty bind statements at the begin

Re: [gomp4] OpenACC wait directive

2014-10-04 Thread Cesar Philippidis
On 10/03/2014 07:34 AM, Cesar Philippidis wrote: > On 09/24/2014 12:18 AM, Ilmir Usmanov wrote: >> Hi Cesar! >> >> Thank you for the patch! >> >> On 24.09.2014 02:29, Cesar Philippidis wrote: >>> This patch adds support for the async clause in the wait dir

Re: [PATCH] libgomp testsuite fixes

2013-06-20 Thread Cesar Philippidis
Ping. Cesar On 5/30/13 12:59 PM, Cesar Philippidis wrote: > Here is a patch from our backlog at Mentor Graphics that addresses a > libgomp issue where setting ENABLE_LTO=1 in site.exp causes the following > error with dejagnu: > > ERROR: (DejaGnu) proc "li

Re: [PATCH] libitm testsuite fixes

2013-06-20 Thread Cesar Philippidis
Ping. Cesar On 5/30/13 1:02 PM, Cesar Philippidis wrote: > Here is a patch from our backlog that addresses a libitm issue where > setting ENABLE_LTO=1 in site.exp causes the following error with dejagnu: > > ERROR: (DejaGnu) proc "libitm_target_compile lin

<    1   2   3   4   5   6   7   >