On Mon, Jul 20, 2015 at 07:08:55PM -0400, Nathan Sidwell wrote:
> 2015-07-20 Nathan Sidwell <[email protected]>
>
> libgomp/
> * target.c (gomp_offload_image_to_device): Rename to ...
> (gomp_load_image_to_device): ... here.
> (GOMP_offload_register): Adjust call.
> (gomp_init_device): Likewise.
> (gomp_unload_image_from_device): New. Broken out of ...
> (GOMP_offload_unregister): ... here. Call it.
> (gomp_unload_device): New.
> * libgomp.h (gomp_unload_device): Declare.
> * oacc-init.c (acc_shutdown_1): Unload from device before deleting
> mem maps.
>
> gcc/
> * config/nvptx/mkoffload.c (process): Add destructor call.
Ok if also tested on Intel MIC, with a few changes:
> + /* Find mapping at start of node array */
> + if (num_funcs || num_vars)
> + {
> + k.host_start = num_funcs ? (uintptr_t) host_func_table[0] :
> (uintptr_t) host_var_table[0];
Too long line, please wrap it.
> + if (devicep->type == target_type && devicep->is_initialized)
> + gomp_unload_image_from_device(devicep, host_table, target_data);
Space before (.
Jakub