diff mbox

[5/n] OpenMP 4.0 offloading infrastructure: libgomp

Message ID 20141024160342.GA11273@msticlxl57.ims.intel.com
State New
Headers show

Commit Message

Ilya Verbin Oct. 24, 2014, 4:03 p.m. UTC
On 08 Oct 13:08, Jakub Jelinek wrote:
> On Mon, Oct 06, 2014 at 07:53:17PM +0400, Ilya Verbin wrote:
> > libgomp/
> > 	* libgomp.map (GOMP_4.0.1): New symbol version.
> > 	Add GOMP_offload_register.
> > 	* libgomp_target.h: New file.
> > 	* splay-tree.h: New file.
> > 	* target.c: Include config.h, libgomp_target.h, dlfcn.h, splay-tree.h.
> > 	(gomp_target_init): New forward declaration.
> > 	(gomp_is_initialized): New static variable.
> > 	(splay_tree_node, splay_tree, splay_tree_key): New typedefs.
> > 	(struct target_mem_desc, struct splay_tree_key_s, offload_image_descr):
> > 	New structures.
> > 	(offload_images, num_offload_images, devices, num_devices): New static
> > 	variables.
> > 	(splay_compare): New static function.
> > 	(struct gomp_device_descr): New structure.
> > 	(gomp_get_num_devices): Call gomp_target_init.
> > 	(resolve_device, gomp_map_vars_existing, gomp_map_vars, gomp_unmap_tgt)
> > 	(gomp_unmap_vars, gomp_update, gomp_init_device): New static functions.
> > 	(GOMP_offload_register): New function.
> > 	(GOMP_target): Arrange for host callback to be performed in a separate
> > 	initial thread and contention group, inheriting ICVs from
> > 	gomp_global_icv etc.  Call gomp_map_vars and gomp_unmap_vars.
> > 	Add device initialization and lookup for target function in splay tree.
> > 	(GOMP_target_data): Add device initialization and call gomp_map_vars.
> > 	(GOMP_target_end_data): Call gomp_unmap_vars.
> > 	(GOMP_target_update): Add device initialization and call gomp_update.
> > 	(gomp_load_plugin_for_device, gomp_register_images_for_device)
> > 	(gomp_target_init): New static functions.
> 
> This looks good to me.

A small addition, refcount and copy_from were uninitialized for globals.




  -- Ilya

Comments

Jakub Jelinek Oct. 24, 2014, 4:07 p.m. UTC | #1
On Fri, Oct 24, 2014 at 08:03:42PM +0400, Ilya Verbin wrote:
> A small addition, refcount and copy_from were uninitialized for globals.
> 
> 
> diff --git a/libgomp/target.c b/libgomp/target.c
> index 4ace170..5b4873b 100644
> --- a/libgomp/target.c
> +++ b/libgomp/target.c
> @@ -647,6 +647,8 @@ gomp_init_device (struct gomp_device_descr *devicep)
>        k->host_start = table[i].host_start;
>        k->host_end = table[i].host_end;
>        k->tgt_offset = 0;
> +      k->refcount = 1;
> +      k->copy_from = false;
>        k->tgt = tgt;
>        node->left = NULL;
>        node->right = NULL;

Is that what Kirill reported today on IRC?  LGTM.

	Jakub
Ilya Verbin Oct. 24, 2014, 4:08 p.m. UTC | #2
On 24 Oct 18:07, Jakub Jelinek wrote:
> On Fri, Oct 24, 2014 at 08:03:42PM +0400, Ilya Verbin wrote:
> > A small addition, refcount and copy_from were uninitialized for globals.
> > 
> > 
> > diff --git a/libgomp/target.c b/libgomp/target.c
> > index 4ace170..5b4873b 100644
> > --- a/libgomp/target.c
> > +++ b/libgomp/target.c
> > @@ -647,6 +647,8 @@ gomp_init_device (struct gomp_device_descr *devicep)
> >        k->host_start = table[i].host_start;
> >        k->host_end = table[i].host_end;
> >        k->tgt_offset = 0;
> > +      k->refcount = 1;
> > +      k->copy_from = false;
> >        k->tgt = tgt;
> >        node->left = NULL;
> >        node->right = NULL;
> 
> Is that what Kirill reported today on IRC?  LGTM.

Right.

  -- Ilya
diff mbox

Patch

diff --git a/libgomp/target.c b/libgomp/target.c
index 4ace170..5b4873b 100644
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -647,6 +647,8 @@  gomp_init_device (struct gomp_device_descr *devicep)
       k->host_start = table[i].host_start;
       k->host_end = table[i].host_end;
       k->tgt_offset = 0;
+      k->refcount = 1;
+      k->copy_from = false;
       k->tgt = tgt;
       node->left = NULL;
       node->right = NULL;