aboutsummaryrefslogtreecommitdiff
path: root/openmp/libomptarget/include/PluginManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/libomptarget/include/PluginManager.h')
-rw-r--r--openmp/libomptarget/include/PluginManager.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/openmp/libomptarget/include/PluginManager.h b/openmp/libomptarget/include/PluginManager.h
index ec5d98d..7768428 100644
--- a/openmp/libomptarget/include/PluginManager.h
+++ b/openmp/libomptarget/include/PluginManager.h
@@ -69,7 +69,7 @@ struct PluginAdaptorTy {
/// Access to the shared object file representing the plugin.
std::unique_ptr<llvm::sys::DynamicLibrary> LibraryHandler;
-#define PLUGIN_API_HANDLE(NAME, MANDATORY) \
+#define PLUGIN_API_HANDLE(NAME) \
using NAME##_ty = decltype(__tgt_rtl_##NAME); \
NAME##_ty *NAME = nullptr;
@@ -114,8 +114,10 @@ struct PluginManager {
// Unregister a shared library from all RTLs.
void unregisterLib(__tgt_bin_desc *Desc);
- void addDeviceImage(__tgt_bin_desc &TgtBinDesc, __tgt_device_image &TgtDeviceImage) {
- DeviceImages.emplace_back(std::make_unique<DeviceImageTy>(TgtBinDesc, TgtDeviceImage));
+ void addDeviceImage(__tgt_bin_desc &TgtBinDesc,
+ __tgt_device_image &TgtDeviceImage) {
+ DeviceImages.emplace_back(
+ std::make_unique<DeviceImageTy>(TgtBinDesc, TgtDeviceImage));
}
/// Return the device presented to the user as device \p DeviceNo if it is
@@ -206,6 +208,12 @@ private:
ProtectedObj<DeviceContainerTy> Devices;
};
+/// Initialize the plugin manager and OpenMP runtime.
+void initRuntime();
+
+/// Deinitialize the plugin and delete it.
+void deinitRuntime();
+
extern PluginManager *PM;
#endif // OMPTARGET_PLUGIN_MANAGER_H