Ping.

On 2015/11/24 6:27 PM, Chung-Lin Tang wrote:
> Hi, this patch reworks some of the way that asynchronous copyouts are
> implemented for OpenACC in libgomp.
> 
> Before this patch, we had a somewhat confusing way of implementing this
> by having two refcounts for each mapping: refcount and async_refcount,
> which I never got working again after the last wave of async regressions
> showed up.
> 
> So this patch implements what I believe to be a simplification: async_refcount
> is removed, and instead of trying to queue the async copyouts during unmapping
> we actually do that during the plugin event handling. This requires a addition
> of the async stream integer as an argument to the register_async_cleanup
> plugin hook, but overall I think this should be more elegant than before.
> 
> This patch fixes the libgomp.oacc-c-c++-common/asyncwait-1.c regression.
> It also fixed data-[23].c regressions before, but some other recent check-in
> happened to already fixed those.
> 
> Tested without regressions, is this okay for trunk?
> 
> Thanks,
> Chung-Lin
> 
> 2015-11-24  Chung-Lin Tang  <clt...@codesourcery.com>
> 
>         * oacc-plugin.h (GOMP_PLUGIN_async_unmap_vars): Add int parameter.
>         * oacc-plugin.c (GOMP_PLUGIN_async_unmap_vars): Add 'int async'
>         parameter, use to set async stream around call to gomp_unmap_vars,
>         call gomp_unmap_vars() with 'do_copyfrom' set to true.
>         * plugin/plugin-nvptx.c (struct ptx_event): Add 'int val' field.
>         (event_gc): Adjust event handling loop, collect PTX_EVT_ASYNC_CLEANUP
>         events and call GOMP_PLUGIN_async_unmap_vars() for each of them.
>         (event_add): Add int parameter, initialize 'val' field when
>         adding new ptx_event struct.
>         (nvptx_evec): Adjust event_add() call arguments.
>         (nvptx_host2dev): Likewise.
>         (nvptx_dev2host): Likewise.
>         (nvptx_wait_async): Likewise.
>         (nvptx_wait_all_async): Likewise.
>         (GOMP_OFFLOAD_openacc_register_async_cleanup): Add async parameter,
>         pass to event_add() call.
>         * oacc-host.c (host_openacc_register_async_cleanup): Add 'int async'
>         parameter.
>         * oacc-mem.c (gomp_acc_remove_pointer): Adjust async case to
>         call openacc.register_async_cleanup_func() hook.
>         * oacc-parallel.c (GOACC_parallel_keyed): Likewise.
>         * target.c (gomp_copy_from_async): Delete function.
>         (gomp_map_vars): Remove async_refcount.
>         (gomp_unmap_vars): Likewise.
>         (gomp_load_image_to_device): Likewise.
>         (omp_target_associate_ptr): Likewise.
>         * libgomp.h (struct splay_tree_key_s): Remove async_refcount.
>         (acc_dispatch_t.register_async_cleanup_func): Add int parameter.
>         (gomp_copy_from_async): Remove.
> 

Reply via email to