Re: [PATCH][gomp4] Plugins Support in LibGOMP (Take 2)

2013-09-23 Thread Ilya Verbin
On 23 Sep 12:26, Jakub Jelinek wrote: > On Thu, Sep 19, 2013 at 08:09:04PM +0400, Michael V. Zolotukhin wrote: > > Hi Jakub, > > > > Updated patch and my answers are below. > > Ok for gomp-4_0-branch. Checked into gomp-4_0-branch by Kirill Yukhin: http://gcc.gnu.org/ml/gcc-cvs/2013-09/msg00692.h

Re: [PATCH i386 3/8] [AVX512] [1/n] Add AVX-512 patterns: VF iterator extended.

2013-09-25 Thread Ilya Verbin
On 24 Sep 10:04, Richard Henderson wrote: > On 08/27/2013 11:37 AM, Kirill Yukhin wrote: > > Hello, > > > >> This patch is still far too large. > >> > >> I think you should split it up based on every single mode iterator that > >> you need to add or change. > > > > Problem is that some iterators

Re: [gomp4] Tweak GOMP_target{,_data,_update} arguments

2013-09-26 Thread Ilya Verbin
On 19 Sep 11:23, Jakub Jelinek wrote: > that. Another complication is dependent shared libraries. > Consider > liba.c: > #pragma omp declare target > int i; > int foo (void) > { > return ++i; > } > #pragma omp end declare target > main.c: > #pragma omp declare target > extern int i; > extern int

Re: [hsa merge 02/10] Modifications to libgomp proper

2016-01-20 Thread Ilya Verbin
gt_vars, > } > > extern "C" void > -GOMP_OFFLOAD_run (int device, void *tgt_fn, void *tgt_vars) > +GOMP_OFFLOAD_run (int device, void *tgt_fn, void *tgt_vars, void **) > { >TRACE ("(device = %d, tgt_fn = %p, tgt_vars = %p)", device, tgt_fn, > tgt_var

Re: [hsa merge 02/10] Modifications to libgomp proper

2016-01-20 Thread Ilya Verbin
On Wed, Jan 13, 2016 at 18:39:27 +0100, Martin Jambor wrote: > * task.c (GOMP_PLUGIN_target_task_completion): Free > firstprivate_copies. Also this change caused 3 fails on intelmicemul: FAIL: libgomp.c/target-32.c execution test FAIL: libgomp.c/target-33.c execution test FAIL: libgom

Re: [hsa merge 07/10] IPA-HSA pass

2016-01-20 Thread Ilya Verbin
On Fri, Jan 15, 2016 at 21:05:47 +0300, Ilya Verbin wrote: > On Fri, Jan 15, 2016 at 17:45:22 +0100, Jakub Jelinek wrote: > > On Fri, Jan 15, 2016 at 07:38:14PM +0300, Ilya Verbin wrote: > > > On Fri, Jan 15, 2016 at 17:09:54 +0100, Jakub Jelinek wrote: > > > > On F

Re: [PING][PATCH] Mark symbols in offload tables with force_output in read_offload_tables

2016-01-25 Thread Ilya Verbin
Hi! On Tue, Jan 05, 2016 at 15:56:15 +0100, Tom de Vries wrote: > >diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c > >index 62e5454..cdaee41 100644 > >--- a/gcc/lto-cgraph.c > >+++ b/gcc/lto-cgraph.c > >@@ -1911,6 +1911,11 @@ input_offload_tables (void) > > tree fn_decl > >

Re: [PING][PATCH] Mark symbols in offload tables with force_output in read_offload_tables

2016-01-26 Thread Ilya Verbin
On Tue, Jan 26, 2016 at 13:21:57 +0100, Tom de Vries wrote: > On 25/01/16 14:27, Ilya Verbin wrote: > >On Tue, Jan 05, 2016 at 15:56:15 +0100, Tom de Vries wrote: > >>>diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c > >>>index 62e5454..cdaee41 100644 > >>

Re: [PATCH, PR69607] Mark offload symbols as global in lto

2016-02-08 Thread Ilya Verbin
On Mon, Feb 08, 2016 at 14:00:00 +0100, Tom de Vries wrote: > when running libgomp.c testsuite with "-flto -flto-partition=1to1 > -fno-toplevel-reorder" we run into many compilation failures like this: > ... > /tmp/.ltrans0.ltrans.o:(.gnu.offload_funcs+0x1a0): undefined > reference to `MAIN

Re: [PING][PATCH] Mark symbols in offload tables with force_output in read_offload_tables

2016-02-08 Thread Ilya Verbin
On Mon, Feb 08, 2016 at 14:20:11 +0100, Tom de Vries wrote: > On 26/01/16 14:01, Ilya Verbin wrote: > >On Tue, Jan 26, 2016 at 13:21:57 +0100, Tom de Vries wrote: > >>On 25/01/16 14:27, Ilya Verbin wrote: > >>>On Tue, Jan 05, 2016 at 15:56:15 +0100, Tom de Vries wrot

Re: [PATCH][RFC][Offloading] Fix PR68463

2016-02-10 Thread Ilya Verbin
Hi! On Tue, Jan 19, 2016 at 16:32:13 +0300, Ilya Verbin wrote: > On Tue, Jan 19, 2016 at 10:36:28 +0100, Jakub Jelinek wrote: > > On Tue, Jan 19, 2016 at 09:57:01AM +0100, Richard Biener wrote: > > > On Mon, 18 Jan 2016, Ilya Verbin wrote: > > > > On Fri, Jan 15, 2

[PATCH][CilkPlus] Fix PR69363

2016-02-17 Thread Ilya Verbin
Hi! This patch fixes Bootstrap and make check passed. OK for... stage 1? gcc/c-family/ PR c++/69363 * c-cilkplus.c (c_finish_cilk_clauses): Remove function. * c-common.h (c_finish_cilk_clauses): Remove declaration. gcc

Re: [PATCH][CilkPlus] Fix PR69363

2016-02-17 Thread Ilya Verbin
On Wed, Feb 17, 2016 at 15:46:00 +0100, Jakub Jelinek wrote: > On Wed, Feb 17, 2016 at 05:32:58PM +0300, Ilya Verbin wrote: > > + && !SCALAR_FLOAT_TYPE_P (TREE_TYPE (t)) > > + && TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE) > > +

Re: [PATCH][CilkPlus] Fix PR69363

2016-02-17 Thread Ilya Verbin
On Wed, Feb 17, 2016 at 16:28:34 +0100, Marek Polacek wrote: > On Wed, Feb 17, 2016 at 04:14:22PM +0100, Jakub Jelinek wrote: > > On Wed, Feb 17, 2016 at 04:11:44PM +0100, Marek Polacek wrote: > > > On Wed, Feb 17, 2016 at 06:08:14PM +0300, Ilya Verbin wrote: > > > >

Re: Partial Offloading (was: [hsa merge 07/10] IPA-HSA pass)

2016-02-17 Thread Ilya Verbin
On Thu, Jan 28, 2016 at 12:36:19 +0100, Thomas Schwinge wrote: > I made an attempt to capture the recent discussion (plus my own > ideas/understanding) in this new section: > . Please > change/extend, as required. Thanks for summarizing this

Re: [PATCH 4/n] OpenMP 4.0 offloading infrastructure: lto-wrapper

2016-02-19 Thread Ilya Verbin
On Fri, Feb 19, 2016 at 20:41:58 +0100, Thomas Schwinge wrote: > Hi! > > On Thu, 2 Oct 2014 19:14:57 +0400, Ilya Verbin wrote: > > With this patch lto-wrapper performs invocation of mkoffload tool for each > > offload target. This tool [...] > > will compile IR from

Re: [PATCH][RFC][Offloading] Fix PR68463

2016-02-20 Thread Ilya Verbin
On Fri, Feb 19, 2016 at 15:53:08 +0100, Jakub Jelinek wrote: > On Wed, Feb 10, 2016 at 08:19:34PM +0300, Ilya Verbin wrote: > > This patch adds crtoffload{begin,end}.o to all -fopenmp programs, if they > > exist. > > I couldn't think of a better solution... > > Te

Re: [PATCH][RFC][Offloading] Fix PR68463

2016-02-22 Thread Ilya Verbin
2016-02-22 18:13 GMT+03:00 Thomas Schwinge : > On Sat, 20 Feb 2016 13:54:20 +0300, Ilya Verbin wrote: >> On Fri, Feb 19, 2016 at 15:53:08 +0100, Jakub Jelinek wrote: >> > On Wed, Feb 10, 2016 at 08:19:34PM +0300, Ilya Verbin wrote: >> > > This patch adds crtoffloa

Re: [PATCH][RFC][Offloading] Fix PR68463

2016-02-24 Thread Ilya Verbin
On Wed, Feb 24, 2016 at 17:13:35 +0100, Thomas Schwinge wrote: > On Tue, 23 Feb 2016 08:37:07 +0100, Tom de Vries > wrote: > > On 22/02/16 19:07, Ilya Verbin wrote: > > > 2016-02-22 18:13 GMT+03:00 Thomas Schwinge: > > >> >On Sat, 20 Feb 2016 13:54:2

Re: [PATCH][RFC][Offloading] Fix PR68463

2016-02-24 Thread Ilya Verbin
On Mon, Feb 22, 2016 at 16:13:07 +0100, Thomas Schwinge wrote: > (..., and similar for others.) The if-exists spec function only works > for absolute paths (I have not researched, why?), so it won't locate the > files for relative -Bbuild-gcc/[...] prefixes, and linking will fail: > > /tmp/cc

[RFC][gomp4] Offloading: Add device initialization and host->target function mapping

2013-12-20 Thread Ilya Verbin
Hi Jakub, Could you please take a look at this patch for libgomp? It adds new function GOMP_register_lib, that should be called from every exec/lib with target regions (that was done in patch [1]). This function maintains the array of pointers to the target shared library descriptors. Also this

Re: [RFC][gomp4] Offloading: Add device initialization and host->target function mapping

2013-12-26 Thread Ilya Verbin
Ping. (Patch is slightly updated) On 20 Dec 21:18, Ilya Verbin wrote: > Hi Jakub, > > Could you please take a look at this patch for libgomp? > > It adds new function GOMP_register_lib, that should be called from every > exec/lib with target regions (that was done in patch [1

Re: [gomp4.1 WIP] omp_target_* libgomp APIs

2015-07-13 Thread Ilya Verbin
On Mon, Jul 13, 2015 at 15:17:29 +0200, Jakub Jelinek wrote: > Here is a new version that I've committed. I've finished up > associate/disassociate, wrote a test and tested also with intelmicemul > offloading. Great! > + k->refcount = INT_MAX; Shouldn't it be UINTPTR_MAX? > + /* FIXME: S

Re: GOMP_offload_register

2015-07-13 Thread Ilya Verbin
On Mon, Jul 13, 2015 at 09:42:50 -0400, Nathan Sidwell wrote: > GOMP_offload_register's target data argument is 'void *'. Is there > any reason it shouldn't be 'const void *'? It would seem to me that > that would be better? > > (a cursory look at i386/intelmic-mkoffload.c suggests a lack of > c

Re: [PATCH 2/4] Add liboffloadmic

2015-07-13 Thread Ilya Verbin
On Thu, Jul 09, 2015 at 12:00:29 +0200, Thomas Schwinge wrote: > I noticed that -- at least with current versions of GCC -- there are > several compiler diagnostics displayed during the build. It would be > nice to get these addressed -- as applicable, presumably in the Intel > upstream version, a

Re: [gomp4.1 WIP] omp_target_* libgomp APIs

2015-07-13 Thread Ilya Verbin
On Mon, Jul 13, 2015 at 16:03:06 +0200, Jakub Jelinek wrote: > On Mon, Jul 13, 2015 at 04:38:33PM +0300, Ilya Verbin wrote: > > On Mon, Jul 13, 2015 at 15:17:29 +0200, Jakub Jelinek wrote: > > > + k->refcount = INT_MAX; > > > > Shouldn't it be UINTPTR

Re: [gomp4.1 WIP] omp_target_* libgomp APIs

2015-07-13 Thread Ilya Verbin
On Mon, Jul 13, 2015 at 17:26:43 +0200, Jakub Jelinek wrote: > > > > > + /* FIXME: Support device-to-device somehow? */ > > > > > > > > Should libgomp copy data device-host-device if device-device is not > > > > supported by > > > > target? Current liboffloadmic doesn't support this. I'll fin

Re: [gomp4.1 WIP] omp_target_* libgomp APIs

2015-07-13 Thread Ilya Verbin
On Mon, Jul 13, 2015 at 18:50:29 +0300, Ilya Verbin wrote: > On Mon, Jul 13, 2015 at 17:26:43 +0200, Jakub Jelinek wrote: > > > > > > + /* FIXME: Support device-to-device somehow? */ > > > > > > > > > > Should libgomp copy data device-host-dev

Re: [gomp4.1] Handle linear clause modifiers in declare simd

2015-07-14 Thread Ilya Verbin
On Wed, Jul 01, 2015 at 12:55:38 +0200, Jakub Jelinek wrote: > * cgraph.h (enum cgraph_simd_clone_arg_type): Add > SIMD_CLONE_ARG_TYPE_LINEAR_REF_CONSTANT_STEP, > SIMD_CLONE_ARG_TYPE_LINEAR_UVAL_CONSTANT_STEP, > and SIMD_CLONE_ARG_TYPE_LINEAR_VAL_CONSTANT_STEP. > (stru

Re: [gomp] constify device data & fix cleanup

2015-07-15 Thread Ilya Verbin
2015-07-15 2:59 GMT+03:00 Nathan Sidwell : > The other thing this does is change the interface between libgommp and the > plugin's load_image and unload_image routines. I've added the ability to > return a pointer to target-specific connection data, and have it provided to > the unload function

Re: [gomp4.1] Support C++ "this" in OpenMP directives

2015-07-15 Thread Ilya Verbin
On Thu, Jul 09, 2015 at 10:50:14 +0200, Jakub Jelinek wrote: > * parser.c (cp_parser_omp_var_list_no_open): Parse this. > * cp-tree.h (finish_omp_declare_simd_methods): New prototype. > * semantics.c (handle_omp_array_sections_1): Disallow this based > array sections for Ope

Re: Tests for libgomp based on OpenMP Examples 4.0.2

2015-07-15 Thread Ilya Verbin
On Wed, Jul 15, 2015 at 12:29:53 +0200, Dominique d'Humières wrote: > > The patch replaces all FP comparisons with inequalities and epsilons > > in those tests for libgomp. > In libgomp/testsuite/libgomp.fortran/examples-4/simd-8.f90 > > integer, parameter :: EPS = 0.005 > > should be > > real,

Re: [gomp] Fix PTX unloading

2015-07-15 Thread Ilya Verbin
On Wed, Jul 15, 2015 at 14:36:45 -0400, Nathan Sidwell wrote: > -= devicep->load_image_func (devicep->target_id, target_data, > &target_table); > += devicep->load_image_func (devicep->target_id, target_data, > + &target_table); It was exactly 80 chars long :)

Re: Constify host-side offload data`

2015-07-16 Thread Ilya Verbin
On Wed, Jul 15, 2015 at 20:56:50 -0400, Nathan Sidwell wrote: > Index: gcc/config/nvptx/mkoffload.c > === > - fprintf (out, "extern void *__OFFLOAD_TABLE__[];\n\n"); > + fprintf (out, "extern const void *conat __OFFLOAD_TABLE__[];\n\

Re: constify target offload data

2015-07-17 Thread Ilya Verbin
On Thu, Jul 16, 2015 at 16:08:47 -0400, Nathan Sidwell wrote: > Jakub, Ilya, > this patch against trunk constifies the offload target data. I'm > having difficulty building an intelmic toolchain, so the changes > there aren't tested. Ilya, if you could check them, that'd be great. Works fine with

Re: [gomp4.1] Fix linear-2.{c,C} testcases

2015-07-17 Thread Ilya Verbin
On Fri, Jul 17, 2015 at 15:54:13 +0200, Jakub Jelinek wrote: > These tests had a thinko, computation performed on the offloaded copy of the > a variable, but then tested on the host side, without #pragma omp target > update or similar. > Fixed thusly. In my testing linear-2.C still causes SIGSEGV

Re: [gomp4.1] Initial support for some OpenMP 4.1 construct parsing

2015-07-17 Thread Ilya Verbin
On Thu, Jun 25, 2015 at 22:10:58 +0200, Jakub Jelinek wrote: > On Thu, Jun 25, 2015 at 10:45:29PM +0300, Ilya Verbin wrote: > > So, as I understood, three tasks will be generated almost simultaneously in > > foo1: one on host and two on target. > > Target task 1 will be

Re: [gomp4.1] Initial support for some OpenMP 4.1 construct parsing

2015-07-20 Thread Ilya Verbin
On Fri, Jul 17, 2015 at 18:43:06 +0200, Jakub Jelinek wrote: > On Fri, Jul 17, 2015 at 07:31:36PM +0300, Ilya Verbin wrote: > > One big question is who will maintain the list of scheduled job, its > > dependencies, etc. - libgomp or each target plugin? > > > > &

Re: fix gomp offload routine unloading

2015-07-21 Thread Ilya Verbin
On Tue, Jul 21, 2015 at 08:15:41 -0400, Nathan Sidwell wrote: > On 07/21/15 05:51, Jakub Jelinek wrote: > >On Mon, Jul 20, 2015 at 07:08:55PM -0400, Nathan Sidwell wrote: > >>2015-07-20 Nathan Sidwell > >> > >>libgomp/ > >>* target.c (gomp_offload_image_to_device): Rename to ... > >>

Re: [PATCH 3/4] Add libgomp plugin for Intel MIC

2015-07-23 Thread Ilya Verbin
On Wed, Jul 08, 2015 at 16:16:44 +0200, Thomas Schwinge wrote: > > --- /dev/null > > +++ b/liboffloadmic/plugin/Makefile.am > > @@ -0,0 +1,123 @@ > > +# Plugin for offload execution on Intel MIC devices. > > > +main_target_image.h: offload_target_main > > + @echo -n "const int image_size = " > $

Re: [gomp4] acc routines bugfix

2015-07-24 Thread Ilya Verbin
On Fri, Jul 24, 2015 at 08:05:00 -0700, Cesar Philippidis wrote: > The second point is interesting. Offloaded functions require the "omp > target" attribute or that function won't reach the lto compiler. That's > fine because not all targets can handle general code. The problem occurs > when a user

Re: [gomp4] acc routines bugfix

2015-07-24 Thread Ilya Verbin
On Fri, Jul 24, 2015 at 17:24:55 +0200, Jakub Jelinek wrote: > On Fri, Jul 24, 2015 at 06:21:34PM +0300, Ilya Verbin wrote: > > On Fri, Jul 24, 2015 at 08:05:00 -0700, Cesar Philippidis wrote: > > > The second point is interesting. Offloaded functions require the "omp >

Re: offload data version number

2015-07-24 Thread Ilya Verbin
On Fri, Jul 24, 2015 at 18:30:16 +0200, Jakub Jelinek wrote: > On Fri, Jul 24, 2015 at 09:32:04AM -0400, Nathan Sidwell wrote: > > On 07/21/15 11:21, Nathan Sidwell wrote: > > >On 07/21/15 09:25, Nathan Sidwell wrote: > > >>This trunk patch implements new register and unregister entry points to >

Re: offload data version number

2015-07-24 Thread Ilya Verbin
On Fri, Jul 24, 2015 at 15:26:38 -0400, Nathan Sidwell wrote: > this version makes the following changes to the earlier version. > > *) Renames things to FOO_ver, rather than FOO_2 > > *) No attempt to deal with cross-version plugins and libgomp. > > *) Adds GOMP_OFFLOAD_version function to plug

Re: [gomp4.1] Support #pragma omp target {enter,exit} data

2015-07-29 Thread Ilya Verbin
On Mon, Jul 06, 2015 at 22:42:10 +0200, Jakub Jelinek wrote: > As has been clarified on omp-lang, we actually shouldn't be mapping or > unmapping the pointer and/or reference, only the array slice itself, except > in target construct (and even for that it is changing from mapping to > private + poi

Re: [gomp4.1] Support #pragma omp target {enter,exit} data

2015-07-30 Thread Ilya Verbin
On Thu, Jul 30, 2015 at 10:12:59 +0200, Jakub Jelinek wrote: > This test will fail on HSA, you don't assume just that it doesn't > fallback to host, but also non-shared address space. > I think it would be better to start with some check for non-shared address > space, like: > /* This test relies o

Re: [gomp4.1] Support #pragma omp target {enter,exit} data

2015-07-30 Thread Ilya Verbin
On Thu, Jul 30, 2015 at 10:12:59 +0200, Jakub Jelinek wrote: > On Wed, Jul 29, 2015 at 10:06:52PM +0300, Ilya Verbin wrote: > > @@ -1241,6 +1245,62 @@ GOMP_target_update (int device, const void *unused, > > size_t mapnum, > >gomp_update (devicep, mapnum, hostaddrs

Re: [PATCH 2/n] OpenMP 4.0 offloading infrastructure: LTO streaming

2015-07-31 Thread Ilya Verbin
On Fri, Jul 31, 2015 at 16:08:27 +0200, Thomas Schwinge wrote: > We had established the use of a boolean flag have_offload in gcc::context > to indicate whether during compilation, we've actually seen any code to > be offloaded (see cited below the relevant parts of the patch by Ilya et > al.). Th

Regression in target MIC compiler (was: nvptx offloading patches [3/n], RFD)

2015-07-31 Thread Ilya Verbin
Hi! I've noticed that target MIC compiler from trunk hangs forever in lto_input_mode_table in this loop, even on simple testcases. On Wed, Feb 18, 2015 at 11:00:35 +0100, Jakub Jelinek wrote: + /* First search just the GET_CLASS_NARROWEST_MODE to wider modes, +if not found, fallback

Re: Regression in target MIC compiler (was: nvptx offloading patches [3/n], RFD)

2015-07-31 Thread Ilya Verbin
On Fri, Jul 31, 2015 at 19:27:58 +0300, Ilya Verbin wrote: > I've noticed that target MIC compiler from trunk hangs forever in > lto_input_mode_table in this loop, even on simple testcases. > > On Wed, Feb 18, 2015 at 11:00:35 +0100, Jakub Jelinek wrote: > + /* F

Re: Regression in target MIC compiler (was: nvptx offloading patches [3/n], RFD)

2015-07-31 Thread Ilya Verbin
On Fri, Jul 31, 2015 at 18:59:59 +0200, Jakub Jelinek wrote: > On Fri, Jul 31, 2015 at 07:53:16PM +0300, Ilya Verbin wrote: > > On Fri, Jul 31, 2015 at 19:27:58 +0300, Ilya Verbin wrote: > > > I've noticed that target MIC compiler from trunk hangs forever in > > > l

Re: Regression in target MIC compiler

2015-08-04 Thread Ilya Verbin
On Tue, Aug 04, 2015 at 14:35:11 +0200, Thomas Schwinge wrote: > On Fri, 31 Jul 2015 20:13:02 +0300, Ilya Verbin wrote: > > On Fri, Jul 31, 2015 at 18:59:59 +0200, Jakub Jelinek wrote: > > > > > On Wed, Feb 18, 2015 at 11:00:35 +0100, Jakub Jelinek wrote: > > > &g

Re: Regression in target MIC compiler

2015-08-04 Thread Ilya Verbin
On Tue, Aug 04, 2015 at 16:07:42 +0200, Richard Biener wrote: > On Tue, Aug 4, 2015 at 3:06 PM, Ilya Verbin wrote: > > On Tue, Aug 04, 2015 at 14:35:11 +0200, Thomas Schwinge wrote: > >> On Fri, 31 Jul 2015 20:13:02 +0300, Ilya Verbin wrote: > >> > On Fri, Jul 31,

Re: [PATCH 2/n] OpenMP 4.0 offloading infrastructure: LTO streaming

2015-08-05 Thread Ilya Verbin
On Wed, Aug 05, 2015 at 10:40:44 +0200, Richard Biener wrote: > On Fri, Jul 31, 2015 at 4:20 PM, Ilya Verbin wrote: > > On Fri, Jul 31, 2015 at 16:08:27 +0200, Thomas Schwinge wrote: > >> We had established the use of a boolean flag have_offload in gcc::context > >>

Re: [PATCH 6/n] OpenMP 4.0 offloading infrastructure: option handling

2015-09-21 Thread Ilya Verbin
2015-09-21 18:15 GMT+03:00 Thomas Schwinge : > (, "--foffload* undocumented", has recently > been filed.) > > (In the following, "intelmic" is short for > "x86_64-intelmicemul-linux-gnu", and "nvptx" is short for "nvptx-none".) > > What is the syntax to use for building

Re: [PATCH 1/3, libgomp] Adjust offload plugin interface for avoiding deadlock on exit

2015-09-24 Thread Ilya Verbin
On Thu, Aug 27, 2015 at 21:44:50 +0800, Chung-Lin Tang wrote: > We've discovered that, for several of the libgomp plugin interface routines, > if the target specific routine calls exit() (usually upon a fatal condition), > deadlock ensues. We found this using nvptx, but it's possible on intelmic as

Re: libgomp: Guard all offload_images/num_offload_images access by register_lock (was: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks)

2015-09-25 Thread Ilya Verbin
On Fri, Sep 25, 2015 at 18:21:27 +0200, Thomas Schwinge wrote: > On Thu, 26 Mar 2015 23:41:30 +0300, Ilya Verbin wrote: > > On Thu, Mar 26, 2015 at 13:09:19 +0100, Jakub Jelinek wrote: > > > the current code is majorly broken. As I've said earlier, e.g. the lack

Re: [PATCH 1/4] Add mkoffload for Intel MIC

2015-09-28 Thread Ilya Verbin
On Mon, Sep 28, 2015 at 12:09:19 +0200, Bernd Schmidt wrote: > On 09/28/2015 12:03 PM, Bernd Schmidt wrote: > >On 09/28/2015 10:26 AM, Thomas Schwinge wrote: > >>- objcopy_argv[8] = NULL; > >>+ objcopy_argv[objcopy_argc++] = NULL; > >>+ gcc_checking_assert (objcopy_argc <= OBJCOPY_ARGC_MAX); > >

[PATCH] liboffloadmic emulation mode: make it asynchronous

2015-09-28 Thread Ilya Verbin
Hi! Currently the COI emulator is single-threaded, i.e. it is able to run only one target function at a time, e.g. the following testcase: #pragma omp parallel sections num_threads(2) { #pragma omp section #pragma omp target while (1) putchar ('.'); #pragma

[PATCH][committed] Fix PR67652: wrong sizeof calculation in liboffloadmic

2015-09-28 Thread Ilya Verbin
Committed to trunk as obvious. PR other/67652 * runtime/offload_engine.cpp (Engine::init_process): Fix sizeof. diff --git a/liboffloadmic/runtime/offload_engine.cpp b/liboffloadmic/runtime/offload_engine.cpp index 16b440d..00b673a 100644 --- a/liboffloadmic/runtime/offload_engine

Re: [PATCH][committed] Fix PR67652: wrong sizeof calculation in liboffloadmic

2015-09-28 Thread Ilya Verbin
On Mon, Sep 28, 2015 at 18:15:14 +0200, Jakub Jelinek wrote: > On Mon, Sep 28, 2015 at 07:10:13PM +0300, Ilya Verbin wrote: > > Committed to trunk as obvious. > > > > PR other/67652 > > * runtime/offload_engine.cpp (Engine::init_process): Fix sizeof. > >

Re: [PATCH] liboffloadmic emulation mode: make it asynchronous

2015-09-29 Thread Ilya Verbin
On Tue, Sep 29, 2015 at 09:01:33 +0200, Jakub Jelinek wrote: > On Mon, Sep 28, 2015 at 05:53:42PM +0300, Ilya Verbin wrote: > > Currently the COI emulator is single-threaded, i.e. it is able to run only > > one > > target function at a time, e.g. the following testcase: &

Re: [gomp4.1] Doacross tweaks

2015-09-30 Thread Ilya Verbin
Hi! On Fri, Sep 25, 2015 at 18:54:47 +0200, Jakub Jelinek wrote: > --- gcc/tree-pretty-print.c.jj2015-09-03 16:35:58.0 +0200 > +++ gcc/tree-pretty-print.c 2015-09-25 15:04:46.911844111 +0200 > @@ -569,7 +569,9 @@ dump_omp_clause (pretty_printer *pp, tre > if (TREE_P

Re: [gomp4.1] depend nowait support for target {update,{enter,exit} data}

2015-10-02 Thread Ilya Verbin
Hi! On Tue, Sep 08, 2015 at 11:20:14 +0200, Jakub Jelinek wrote: > nowait support for #pragma omp target is not implemented yet, supposedly we > need to mark those somehow (some flag) already in the struct gomp_task > structure, essentially it will need either 2 or 3 callbacks > (the current one,

Re: [PATCH][committed] Fix PR67652: wrong sizeof calculation in liboffloadmic

2015-10-08 Thread Ilya Verbin
On Mon, Sep 28, 2015 at 18:15:14 +0200, Jakub Jelinek wrote: > > -char * env_var = (char*) > > malloc(sizeof("COI_DMA_CHANNEL_COUNT=2" + 1)); > > +char * env_var = (char*) > > malloc(sizeof("COI_DMA_CHANNEL_COUNT=2")); > > sprintf(env_var, "COI_DMA_CHANNEL_COU

Re: libgomp: Guard all devices/num_devices/num_devices_openmp access by register_lock

2015-10-09 Thread Ilya Verbin
On Fri, Oct 09, 2015 at 13:58:32 +0200, Bernd Schmidt wrote: > One oddity I noticed in target.c is that there are two different num_devices > variables: > > /* Total number of available devices. */ > static int num_devices; > > /* Number of GOMP_OFFLOAD_CAP_OPENMP_400 devices. */ > stat

Re: [gomp4.1] OpenMP 4.1 is dead, long live OpenMP 4.5

2015-10-09 Thread Ilya Verbin
On Fri, Oct 09, 2015 at 09:55:07 +0200, Jakub Jelinek wrote: > -GOMP_4.1 { > +GOMP_4.5 { >global: > GOMP_target_41; > GOMP_target_data_41; Should we rename it to GOMP_target*_45, or do you know some more mnemonic name? -- Ilya

Re: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data

2015-10-13 Thread Ilya Verbin
On Mon, Jun 15, 2015 at 22:48:50 +0300, Ilya Verbin wrote: > @@ -950,50 +997,41 @@ GOMP_target (int device, void (*fn) (void *), const > void *unused, > ... > + devicep->run_func (devicep->target_id, fn_addr, (void *) > tgt_vars->tgt_start); If mapnum is 0, tgt_vars->

Re: [gomp4.1] depend nowait support for target {update,{enter,exit} data}

2015-10-15 Thread Ilya Verbin
On Thu, Oct 15, 2015 at 16:01:56 +0200, Jakub Jelinek wrote: > On Fri, Oct 02, 2015 at 10:28:01PM +0300, Ilya Verbin wrote: > > Here is my WIP patch. target.c part is obviously incorrect, but it > > demonstrates > > a possible libgomp <-> plugin interface for run

Re: OpenACC async clause regressions (was: [gomp4.1] Add new versions of GOMP_target{,_data,_update} and GOMP_target_enter_exit_data)

2015-10-19 Thread Ilya Verbin
On Mon, Oct 19, 2015 at 18:24:35 +0200, Thomas Schwinge wrote: > Chung-Lin, would you please have a look at the following (on > gomp-4_0-branch)? Also, anyone else got any ideas off-hand? > > PASS: libgomp.oacc-c/../libgomp.oacc-c-c++-common/data-2.c > -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SH

Re: [gomp4.1] depend nowait support for target {update,{enter,exit} data}

2015-10-19 Thread Ilya Verbin
On Thu, Oct 15, 2015 at 16:01:56 +0200, Jakub Jelinek wrote: > >void *fn_addr = gomp_get_target_fn_addr (devicep, fn); > > > > + if (flags & GOMP_TARGET_FLAG_NOWAIT) > > +{ > > + gomp_create_target_task (devicep, fn_addr, mapnum, hostaddrs, sizes, > > + kind

Re: [gomp4] lto error message

2015-10-20 Thread Ilya Verbin
On Tue, Oct 20, 2015 at 15:54:45 -0400, Nathan Sidwell wrote: > @@ -1209,16 +1209,11 @@ input_overwrite_node (struct lto_file_de > >if (!success) > { > - if (flag_openacc) > - { > - if (TREE_CODE (node->decl) == FUNCTION_DECL) > - error ("Missing routine function %

Re: Constify host-side offload data`

2015-10-21 Thread Ilya Verbin
Hi! On Wed, Jul 15, 2015 at 20:56:50 -0400, Nathan Sidwell wrote: > --- libgcc/offloadstuff.c (revision 225851) > +++ libgcc/offloadstuff.c (working copy) > ... > -void *__offload_func_table[0] > +const void *const __offload_func_table[0] > ... > -void *__offload_var_table[0] > +const void

Re: Constify host-side offload data`

2015-10-21 Thread Ilya Verbin
On Wed, Oct 21, 2015 at 10:38:10 -0700, H.J. Lu wrote: > On Wed, Oct 21, 2015 at 10:33 AM, Ilya Verbin wrote: > > H.J., > > Maybe linker should print some warning about joining writable + nonwritable > > sections? Here is a simple testcase: > > > > $ cat t1.s &

Re: [OpenACC 11/11] execution tests

2015-10-21 Thread Ilya Verbin
> On 21 Oct 2015, at 22:53, Nathan Sidwell wrote: > > This patch has some new execution tests, verifying loop partitioning is > behaving as expected. > > There are more execution tests on the gomp4 branch, but many of them use > reductions. We'll merge those once reductions are merged. > >

Re: Constify host-side offload data`

2015-10-22 Thread Ilya Verbin
On Wed, Oct 21, 2015 at 10:44:56 -0700, H.J. Lu wrote: > On Wed, Oct 21, 2015 at 10:42 AM, Ilya Verbin wrote: > > On Wed, Oct 21, 2015 at 10:38:10 -0700, H.J. Lu wrote: > >> On Wed, Oct 21, 2015 at 10:33 AM, Ilya Verbin wrote: > >> > H.J., > >> > Ma

Re: Constify host-side offload data`

2015-10-22 Thread Ilya Verbin
On Thu, Oct 22, 2015 at 07:35:55 -0700, H.J. Lu wrote: > On Thu, Oct 22, 2015 at 7:11 AM, Ilya Verbin wrote: > > On Wed, Oct 21, 2015 at 10:44:56 -0700, H.J. Lu wrote: > >> On Wed, Oct 21, 2015 at 10:42 AM, Ilya Verbin wrote: > >> > On Wed, Oct 21, 2015 at

Re: [PATCH 0/4] OpenMP 4.0 offloading to Intel MIC

2015-10-22 Thread Ilya Verbin
On Mon, Dec 22, 2014 at 13:01:40 +0100, Thomas Schwinge wrote: > By chance (when tracking down a different problem), I've found the > following. Would you please check whether that's a real problem in > liboffloadmic, or its libgomp plugin, or just a mis-diagnosis by > Valgrind? > > ==21327==

Re: [gomp4.1] map clause parsing improvements

2015-10-26 Thread Ilya Verbin
On Tue, Oct 20, 2015 at 12:03:40 +0200, Jakub Jelinek wrote: > On Mon, Oct 19, 2015 at 05:00:33PM +0200, Thomas Schwinge wrote: > > n = splay_tree_lookup (ctx->variables, (splay_tree_key) decl); > > if ((ctx->region_type & ORT_TARGET) != 0 > > && !(n->v

Re: [gomp4.1] map clause parsing improvements

2015-10-26 Thread Ilya Verbin
On Mon, Oct 26, 2015 at 14:07:13 +0100, Jakub Jelinek wrote: > On Mon, Oct 26, 2015 at 03:53:57PM +0300, Ilya Verbin wrote: > > @@ -7363,7 +7363,7 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, tree > > *list_p, > > n = splay_tree_lookup (ctx->variable

Re: [PATCH 0/4] OpenMP 4.0 offloading to Intel MIC

2015-10-26 Thread Ilya Verbin
On Fri, Oct 23, 2015 at 10:10:06 +0200, Jakub Jelinek wrote: > On Thu, Oct 22, 2015 at 09:26:37PM +0300, Ilya Verbin wrote: > > On Mon, Dec 22, 2014 at 13:01:40 +0100, Thomas Schwinge wrote: > > > By chance (when tracking down a different problem), I've found the > > &

Re: [gomp4.1] Handle new form of #pragma omp declare target

2015-10-26 Thread Ilya Verbin
On Fri, Jul 17, 2015 at 15:05:59 +0200, Jakub Jelinek wrote: > As the testcases show, #pragma omp declare target has now a new form (well, > two; with some issues on it pending), where it is used just as a single > declarative directive rather than a pair of them and allows marking > vars and funct

Re: [gomp4.1] Handle new form of #pragma omp declare target

2015-10-26 Thread Ilya Verbin
On Mon, Oct 26, 2015 at 20:05:39 +0100, Jakub Jelinek wrote: > On Mon, Oct 26, 2015 at 09:35:52PM +0300, Ilya Verbin wrote: > > On Fri, Jul 17, 2015 at 15:05:59 +0200, Jakub Jelinek wrote: > > > As the testcases show, #pragma omp declare target has now a new form > > >

Re: [gomp4.1] Handle new form of #pragma omp declare target

2015-10-27 Thread Ilya Verbin
On Fri, Jul 17, 2015 at 15:05:59 +0200, Jakub Jelinek wrote: > As the testcases show, #pragma omp declare target has now a new form (well, > two; with some issues on it pending), where it is used just as a single > declarative directive rather than a pair of them and allows marking > vars and funct

Re: [gomp4.1] Handle new form of #pragma omp declare target

2015-10-30 Thread Ilya Verbin
On Wed, Oct 28, 2015 at 00:11:03 +0300, Ilya Verbin wrote: > On Fri, Jul 17, 2015 at 15:05:59 +0200, Jakub Jelinek wrote: > > As the testcases show, #pragma omp declare target has now a new form (well, > > two; with some issues on it pending), where it is used just as a single

Re: [gomp4.1] Handle new form of #pragma omp declare target

2015-11-02 Thread Ilya Verbin
On Fri, Oct 30, 2015 at 20:12:25 +0100, Jakub Jelinek wrote: > On Fri, Oct 30, 2015 at 08:44:07PM +0300, Ilya Verbin wrote: > > On Wed, Oct 28, 2015 at 00:11:03 +0300, Ilya Verbin wrote: > > > On Fri, Jul 17, 2015 at 15:05:59 +0200, Jakub Jelinek wrote: > > > > As t

Re: [ptx] partitioning optimization

2015-11-10 Thread Ilya Verbin
> I've been unable to introduce a testcase for this. The difficulty is we want > to check an rtl dump from the acceleration compiler, and there doesn't > appear to be existing machinery for that in the testsuite. Perhaps > something to be added later? I haven't tried it, but doesn't /* { dg-optio

Re: [gomp4.5] depend nowait support for target

2015-11-12 Thread Ilya Verbin
On Wed, Nov 11, 2015 at 17:52:22 +0100, Jakub Jelinek wrote: > On Mon, Oct 19, 2015 at 10:47:54PM +0300, Ilya Verbin wrote: > > So, here is what I have for now. Attached target-29.c testcase works fine > > with > > MIC emul, however I don't know how to (and

Re: [gomp4.5] depend nowait support for target

2015-11-12 Thread Ilya Verbin
On Thu, Nov 12, 2015 at 18:58:22 +0100, Jakub Jelinek wrote: > > Unfortunately, target-32.c fails for me using emulation mode: > > I haven't managed to get it stuck yet (unlike the target-33.c one, see > another mail), what OMP_NUM_THREADS you are using > and how many cores/threads? OMP_NUM_THREA

Re: [gomp4.5] depend nowait support for target

2015-11-12 Thread Ilya Verbin
On Thu, Nov 12, 2015 at 18:45:09 +0100, Jakub Jelinek wrote: > But the testcase I wrote (target-33.c) hangs, the problem is in the > #pragma omp target nowait map (tofrom: a, b) depend(out: d[3]) > { > #pragma omp atomic update > a = a + 9; > b -= 8; > } > #pragma omp target now

Re: [gomp4.5] depend nowait support for target

2015-11-13 Thread Ilya Verbin
On Fri, Nov 13, 2015 at 16:11:50 +0100, Jakub Jelinek wrote: > On Fri, Nov 13, 2015 at 11:18:41AM +0100, Jakub Jelinek wrote: > > For the offloading case, I actually see a problematic spot, namely that > > GOMP_PLUGIN_target_task_completion could finish too early, and get the > > task_lock before t

Re: [gomp4.5] depend nowait support for target

2015-11-13 Thread Ilya Verbin
On Fri, Nov 13, 2015 at 17:41:53 +0100, Jakub Jelinek wrote: > On Fri, Nov 13, 2015 at 07:37:17PM +0300, Ilya Verbin wrote: > > I don't know which interface to implement to maintain compatibility in the > > future. > > Anyway, currently it's impossible t

[gomp4.5] Handle #pragma omp declare target link

2015-11-16 Thread Ilya Verbin
Hi! On Mon, Oct 26, 2015 at 20:49:40 +0100, Jakub Jelinek wrote: > On Mon, Oct 26, 2015 at 10:39:04PM +0300, Ilya Verbin wrote: > > > Without declare target link or to, you can't use the global variables > > > in orphaned accelerated routines (unless you e.g. take the a

Re: [PATCH] Implement GOMP_OFFLOAD_unload_image in intelmic plugin

2015-11-16 Thread Ilya Verbin
On Tue, Sep 08, 2015 at 22:41:17 +0300, Ilya Verbin wrote: > This patch supports unloading of target images from the device. > Unfortunately __offload_unregister_image requires the whole descriptor for > unloading, which must contain target code inside, for this reason the plugi

Re: libgomp: Compile-time error for non-portable gomp_mutex_t initialization

2015-11-18 Thread Ilya Verbin
On Fri, Sep 25, 2015 at 17:28:25 +0200, Jakub Jelinek wrote: > On Fri, Sep 25, 2015 at 05:04:47PM +0200, Thomas Schwinge wrote: > > On Thu, 26 Mar 2015 23:41:30 +0300, Ilya Verbin wrote: > > > On Thu, Mar 26, 2015 at 13:09:19 +0100, Jakub Jelinek wrote: > > > > the

Re: [gomp4.1] Handle linear clause modifiers in declare simd

2015-11-18 Thread Ilya Verbin
Hi! On Wed, Jul 01, 2015 at 12:55:38 +0200, Jakub Jelinek wrote: > I've committed following patch, which per the new ABI additions > mangles and handles the various new linear clause modifiers in > declare simd functions. The vectorizer side is not done yet, > > [...] > > @@ -14195,12 +14216,25 @

Re: [PATCH] Implement GOMP_OFFLOAD_unload_image in intelmic plugin

2015-11-19 Thread Ilya Verbin
On Thu, Nov 19, 2015 at 14:33:06 +0100, Jakub Jelinek wrote: > On Mon, Nov 16, 2015 at 08:33:28PM +0300, Ilya Verbin wrote: > > diff --git a/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp > > b/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp > > index 772e198..6ee

Re: [PATCH 6/n] OpenMP 4.0 offloading infrastructure: option handling

2015-11-20 Thread Ilya Verbin
On Wed, Dec 10, 2014 at 01:48:21 +0300, Ilya Verbin wrote: > On 09 Dec 14:59, Richard Biener wrote: > > On Mon, 8 Dec 2014, Ilya Verbin wrote: > > > Unfortunately, this fix was not general enough. > > > There might be cases when mixed object files get into lto-wrapper, i

Re: Enable pointer TBAA for LTO

2015-11-23 Thread Ilya Verbin
On Mon, Nov 23, 2015 at 16:31:42 +0100, Richard Biener wrote: > I think it also causes the following and one related ICE > > FAIL: gcc.dg/vect/pr62021.c -flto -ffat-lto-objects (internal compiler > error) > > /space/rguenther/src/svn/trunk3/gcc/testsuite/gcc.dg/vect/pr62021.c:7:1: > internal co

Re: [PATCH 12/12] always define ENABLE_OFFLOADING

2015-11-23 Thread Ilya Verbin
On Mon, Nov 09, 2015 at 19:41:21 +0100, Bernd Schmidt wrote: > On 11/09/2015 05:47 PM, tbsaunde+...@tbsaunde.org wrote: > >-#ifdef ENABLE_OFFLOADING > >/* If the user didn't specify any, default to all configured offload > > targets. */ > >if (offload_targets == NULL) > > handle

  1   2   3   4   >