summaryrefslogtreecommitdiff
path: root/offload/include/Shared
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2024-04-29 11:18:37 -0500
committerGitHub <noreply@github.com>2024-04-29 11:18:37 -0500
commitb07177fb68d396cc9063ac4899e4d67f6765597f (patch)
tree8f2821a1147400efd4b84633551fcd90f90cef2d /offload/include/Shared
parente3750fb65acf0f7447f6a49a0ba5d3197f4d9766 (diff)
[Libomptarget] Rework interface for enabling plugins (#86875)
Summary: Previously we would build all of the plugins by default and then only load some using the `LIBOMPTARGET_PLUGINS_TO_LOAD` variable. This patch renamed this to `LIBOMPTARGET_PLUGINS_TO_BUILD` and changes whether or not it will include the plugin in CMake. Additionally this patch creates a new `Targets.def` file that allows us to enumerate all of the enabled plugins. This is somewhat different from the old method, and it's done this way for future use that will need to be shared. This follows the same method that LLVM uses for its targets, however it does require adding an extra include path. Depends on https://github.com/llvm/llvm-project/pull/86868
Diffstat (limited to 'offload/include/Shared')
-rw-r--r--offload/include/Shared/Targets.def.in20
1 files changed, 20 insertions, 0 deletions
diff --git a/offload/include/Shared/Targets.def.in b/offload/include/Shared/Targets.def.in
new file mode 100644
index 000000000000..f34b523b4542
--- /dev/null
+++ b/offload/include/Shared/Targets.def.in
@@ -0,0 +1,20 @@
+//===-- Shared/Targets.def - Target plugin enumerator -----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Enumerates over all of the supported target plugins that are available to
+// the offloading library.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef PLUGIN_TARGET
+# error Please define the macro PLUGIN_TARGET(TargetName)
+#endif
+
+@LIBOMPTARGET_ENUM_PLUGIN_TARGETS@
+
+#undef PLUGIN_TARGET