[gomp4] Asynchronous data unmapping & wait fixes for OpenACC

Julian Brown julian@codesourcery.com
Fri Oct 17 16:13:00 GMT 2014


Hi,

This patch introduces a new plugin hook in libgomp to register a
callback function to clean up host-side bookkeeping data after an
asynchronous operation has completed (replacing the previous ad-hoc
method used in the NVPTX backend), and adds code to ensure that same
cleanup is done reliably in the NVPTX backend when the user program
hits a "wait" directive, or equivalent.

OK for the gomp4 branch?

Thanks,

Julian

ChangeLog

    libgomp/
    * oacc-host.c (openacc_register_async_cleanup): New.
    (host_dispatch): Initialise register_async_cleanup_func entry.
    * oacc-int.h (struct ACC_dispatch_t): Add
    register_async_cleanup_func hook.
    * oacc-parallel.c (GOACC_parallel): Call
    register_async_cleanup_func hook after queuing asynchronous
    copy-back.
    * plugin-nvptx.c (enum PTX_event_type): Add PTX_EVT_ASYNC_CLEANUP.
    (struct PTX_event): Remove tgt field.
    (event_gc): Don't do async cleanup in PTX_EVT_KNL, do it in
    PTX_EVT_ASYNC_CLEANUP instead.
    (event_add): Remove tgt argument. Support PTX_EVT_ASYNC_CLEANUP
    events.
    (PTX_exec, PTX_host2dev, PTX_dev2host, PTX_wait_async)
    (PTX_wait_all_async): Update calls to event_add.
    (openacc_register_async_cleanup): New.
    (PTX_async_test): Call event_gc on success path.
    (PTX_async_test_all): Likewise.
    * target.c (gomp_load_plugin_for_device): Initialise
    register_async_cleanup hook.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: async-fixes-1.diff
Type: text/x-patch
Size: 7721 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141017/88fc1c47/attachment.bin>


More information about the Gcc-patches mailing list