diff --git a/openmp/libomptarget/include/omptargetplugin.h b/openmp/libomptarget/include/omptargetplugin.h index 2580731112da2..40e58665b0995 100644 --- a/openmp/libomptarget/include/omptargetplugin.h +++ b/openmp/libomptarget/include/omptargetplugin.h @@ -23,9 +23,6 @@ extern "C" { // First method called on the plugin int32_t __tgt_rtl_init_plugin(); -// Last method called on the plugin -int32_t __tgt_rtl_deinit_plugin(); - // Return the number of available devices of the type supported by the // target RTL. int32_t __tgt_rtl_number_of_devices(void); diff --git a/openmp/libomptarget/include/rtl.h b/openmp/libomptarget/include/rtl.h index b305b8f9c398f..d5ac097302194 100644 --- a/openmp/libomptarget/include/rtl.h +++ b/openmp/libomptarget/include/rtl.h @@ -32,7 +32,6 @@ struct __tgt_bin_desc; struct RTLInfoTy { typedef int32_t(init_plugin_ty)(); - typedef int32_t(deinit_plugin_ty)(); typedef int32_t(is_valid_binary_ty)(void *); typedef int32_t(is_valid_binary_info_ty)(void *, void *); typedef int32_t(is_data_exchangable_ty)(int32_t, int32_t); @@ -90,7 +89,6 @@ struct RTLInfoTy { // Functions implemented in the RTL. init_plugin_ty *init_plugin = nullptr; - deinit_plugin_ty *deinit_plugin = nullptr; is_valid_binary_ty *is_valid_binary = nullptr; is_valid_binary_info_ty *is_valid_binary_info = nullptr; is_data_exchangable_ty *is_data_exchangable = nullptr; diff --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp index fb4db4adf0a36..f517c8371b334 100644 --- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp +++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp @@ -1632,17 +1632,6 @@ int32_t __tgt_rtl_init_plugin() { return OFFLOAD_SUCCESS; } -int32_t __tgt_rtl_deinit_plugin() { - auto Err = Plugin::deinitIfNeeded(); - if (Err) { - REPORT("Failure to deinitialize plugin " GETNAME(TARGET_NAME) ": %s\n", - toString(std::move(Err)).data()); - return OFFLOAD_FAIL; - } - - return OFFLOAD_SUCCESS; -} - int32_t __tgt_rtl_is_valid_binary(__tgt_device_image *TgtImage) { if (!Plugin::isActive()) return false; diff --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h index 9174ecaab08ca..fdbe23eeb2c04 100644 --- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h +++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h @@ -1167,13 +1167,6 @@ class Plugin { return Error::success(); } - // Deinitialize the plugin if needed. The plugin could have been deinitialized - // because the plugin library was exiting. - static Error deinitIfNeeded() { - // Do nothing. The plugin is deinitialized automatically. - return Plugin::success(); - } - /// Get a reference (or create if it was not created) to the plugin instance. static GenericPluginTy &get() { // This static variable will initialize the underlying plugin instance in diff --git a/openmp/libomptarget/src/rtl.cpp b/openmp/libomptarget/src/rtl.cpp index b48a3fccd86fc..4688f3ed53af8 100644 --- a/openmp/libomptarget/src/rtl.cpp +++ b/openmp/libomptarget/src/rtl.cpp @@ -193,8 +193,6 @@ bool RTLsTy::attemptLoadRTL(const std::string &RTLName, RTLInfoTy &RTL) { DP("Registering RTL %s supporting %d devices!\n", Name, RTL.NumberOfDevices); // Optional functions - *((void **)&RTL.deinit_plugin) = - DynLibrary->getAddressOfSymbol("__tgt_rtl_deinit_plugin"); *((void **)&RTL.is_valid_binary_info) = DynLibrary->getAddressOfSymbol("__tgt_rtl_is_valid_binary_info"); *((void **)&RTL.deinit_device) = @@ -598,14 +596,5 @@ void RTLsTy::unregisterLib(__tgt_bin_desc *Desc) { PM->TblMapMtx.unlock(); - // TODO: Write some RTL->unload_image(...) function? - for (auto *R : UsedRTLs) { - if (R->deinit_plugin) { - if (R->deinit_plugin() != OFFLOAD_SUCCESS) { - DP("Failure deinitializing RTL %s!\n", R->RTLName.c_str()); - } - } - } - DP("Done unregistering library!\n"); }