diff options
Diffstat (limited to 'liboffloadmic')
-rw-r--r-- | liboffloadmic/ChangeLog | 6 | ||||
-rw-r--r-- | liboffloadmic/plugin/libgomp-plugin-intelmic.cpp | 17 |
2 files changed, 9 insertions, 14 deletions
diff --git a/liboffloadmic/ChangeLog b/liboffloadmic/ChangeLog index fb9fa85..c6fd49f 100644 --- a/liboffloadmic/ChangeLog +++ b/liboffloadmic/ChangeLog @@ -1,3 +1,9 @@ +2015-12-14 Ilya Verbin <ilya.verbin@intel.com> + + * plugin/libgomp-plugin-intelmic.cpp (unregister_main_image): Remove. + (register_main_image): Do not call unregister_main_image at exit. + (GOMP_OFFLOAD_fini_device): Allow for OpenMP. Unregister main image. + 2015-11-19 Ilya Verbin <ilya.verbin@intel.com> * plugin/libgomp-plugin-intelmic.cpp (struct TargetImageDesc): New. diff --git a/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp b/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp index f8c1725..68f7b2c 100644 --- a/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp +++ b/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp @@ -231,12 +231,6 @@ offload (const char *file, uint64_t line, int device, const char *name, } static void -unregister_main_image () -{ - __offload_unregister_image (&main_target_image); -} - -static void register_main_image () { /* Do not check the return value, because old versions of liboffloadmic did @@ -246,12 +240,6 @@ register_main_image () /* liboffloadmic will call GOMP_PLUGIN_target_task_completion when asynchronous task on target is completed. */ __offload_register_task_callback (GOMP_PLUGIN_target_task_completion); - - if (atexit (unregister_main_image) != 0) - { - fprintf (stderr, "%s: atexit failed\n", __FILE__); - exit (1); - } } /* liboffloadmic loads and runs offload_target_main on all available devices @@ -269,8 +257,9 @@ extern "C" void GOMP_OFFLOAD_fini_device (int device) { TRACE ("(device = %d)", device); - /* Unreachable for GOMP_OFFLOAD_CAP_OPENMP_400. */ - abort (); + + /* liboffloadmic will finalize target processes on all available devices. */ + __offload_unregister_image (&main_target_image); } static void |