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

2019-11-14 Thread Julian Brown
On Thu, 14 Nov 2019 12:08:45 +0100 Thomas Schwinge wrote: > Hi! > > In context of reviewing Julian's "OpenACC reference count overhaul", > I'm generally reviewing (also known as: trying to understand) the > libgomp OpenMP 'target' "refcount"ing , and I noticed something > strange (?): > > On 20

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

2019-11-14 Thread Jakub Jelinek
On Thu, Nov 14, 2019 at 12:08:45PM +0100, Thomas Schwinge wrote: > > @@ -794,7 +807,7 @@ gomp_offload_image_to_device (struct gomp_device_descr > > *devicep, > >/* Insert host-target address mapping into splay tree. */ > >struct target_mem_desc *tgt = gomp_malloc (sizeof (*tgt)); > >t

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

2019-11-14 Thread Thomas Schwinge
Hi! In context of reviewing Julian's "OpenACC reference count overhaul", I'm generally reviewing (also known as: trying to understand) the libgomp OpenMP 'target' "refcount"ing , and I noticed something strange (?): On 2015-07-30T22:44:33+0300, Ilya Verbin wrote: > make check-target-libgomp pass

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

2015-07-30 Thread Jakub Jelinek
On Thu, Jul 30, 2015 at 10:44:33PM +0300, Ilya Verbin wrote: > libgomp/ > * libgomp.h (enum gomp_map_vars_kind): New. > (gomp_map_vars): Change type of the argument from bool to enum > gomp_map_vars_kind. > * oacc-mem.c (acc_map_data, present_create_copy, > gomp_acc_in

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, sizes, kinds, false); > > }

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

2015-07-30 Thread Jakub Jelinek
On Thu, Jul 30, 2015 at 05:40:15PM +0300, Ilya Verbin wrote: > Sure, but it's not possible to fully test data mapping without non-shared > address space. I've created new check_effective_target, ok for > gomp-4_1-branch? > > > * testsuite/lib/libgomp.exp > (check_effective_target_of

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 Jakub Jelinek
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, sizes, kinds, false); > } > > +static void > +gomp_exit_data (struct gomp_device_descr *device

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-06 Thread Jakub Jelinek
On Mon, Jul 06, 2015 at 09:45:30PM +0300, Ilya Verbin wrote: > > What exactly do you have in mind here? > > > > void foo (int *p) > > { > > #pragma omp enter data (to:p[10]) > > ... > > #pragma omp exit data (from:p[10]) > > } > > > > where the latter will only deallocate &p[0] ... &p[9], but not

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

2015-07-06 Thread Ilya Verbin
On Mon, Jul 06, 2015 at 19:25:09 +0200, Jakub Jelinek wrote: > On Mon, Jul 06, 2015 at 06:34:25PM +0300, Ilya Verbin wrote: > > On Thu, Jul 02, 2015 at 00:06:58 +0300, Ilya Verbin wrote: > > > The patch is not ready though, I don't know how to unmap GOMP_MAP_POINTER > > > vars. > > > In gomp_unmap

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

2015-07-06 Thread Jakub Jelinek
On Mon, Jul 06, 2015 at 06:34:25PM +0300, Ilya Verbin wrote: > On Thu, Jul 02, 2015 at 00:06:58 +0300, Ilya Verbin wrote: > > On Tue, Jun 30, 2015 at 18:10:44 +0200, Jakub Jelinek wrote: > > > The thing is whether it is actually a good idea to allocate the enter data > > > allocated objects togethe

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

2015-07-06 Thread Ilya Verbin
On Thu, Jul 02, 2015 at 00:06:58 +0300, Ilya Verbin wrote: > On Tue, Jun 30, 2015 at 18:10:44 +0200, Jakub Jelinek wrote: > > The thing is whether it is actually a good idea to allocate the enter data > > allocated objects together. > > In OpenMP 4.0, generally objects would be allocated and deallo

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

2015-07-01 Thread Ilya Verbin
On Tue, Jun 30, 2015 at 18:10:44 +0200, Jakub Jelinek wrote: > The thing is whether it is actually a good idea to allocate the enter data > allocated objects together. > In OpenMP 4.0, generally objects would be allocated and deallocated at the > same times, except for multiple host threads trying

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

2015-06-30 Thread Jakub Jelinek
On Tue, Jun 30, 2015 at 06:42:01PM +0300, Ilya Verbin wrote: > On Tue, Jun 30, 2015 at 14:57:02 +0200, Jakub Jelinek wrote: > > On Tue, Jun 30, 2015 at 03:19:30PM +0300, Ilya Verbin wrote: > > > --- a/libgomp/target.c > > > +++ b/libgomp/target.c > > > @@ -580,10 +581,16 @@ gomp_unmap_vars (struct

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

2015-06-30 Thread Ilya Verbin
On Tue, Jun 30, 2015 at 14:57:02 +0200, Jakub Jelinek wrote: > On Tue, Jun 30, 2015 at 03:19:30PM +0300, Ilya Verbin wrote: > > --- a/libgomp/target.c > > +++ b/libgomp/target.c > > @@ -580,10 +581,16 @@ gomp_unmap_vars (struct target_mem_desc *tgt, bool > > do_copyfrom) > >bool do_unmap =

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

2015-06-30 Thread Jakub Jelinek
On Tue, Jun 30, 2015 at 03:19:30PM +0300, Ilya Verbin wrote: > --- a/libgomp/target.c > +++ b/libgomp/target.c > @@ -580,10 +581,16 @@ gomp_unmap_vars (struct target_mem_desc *tgt, bool > do_copyfrom) >bool do_unmap = false; >if (k->refcount > 1) > k->refcount--; > - els