[Openmp-commits] [openmp] [OpenMP] Add unit tests for nextgen plugins (PR #74398)
Jan Patrick Lehr via Openmp-commits
openmp-commits at lists.llvm.org
Wed Dec 20 00:25:55 PST 2023
================
@@ -0,0 +1,146 @@
+#include "Shared/PluginAPI.h"
+#include "omptarget.h"
+#include "gtest/gtest.h"
+
+const int DEVICE_ID = 0, DEVICE_TWO = 1;
+bool setup_map[DEVICE_TWO + 1];
+
+int init_test_device(int ID) {
+ if (setup_map[ID]) {
+ return OFFLOAD_SUCCESS;
+ }
+ if (__tgt_rtl_init_plugin() == OFFLOAD_FAIL ||
+ __tgt_rtl_init_device(ID) == OFFLOAD_FAIL) {
+ return OFFLOAD_FAIL;
+ }
+ setup_map[ID] = true;
+ return OFFLOAD_SUCCESS;
+}
+
+// Test plugin initialization
+TEST(NextgenPluginsTest, PluginInit) {
----------------
jplehr wrote:
That makes sense, thanks for explaining.
https://github.com/llvm/llvm-project/pull/74398
More information about the Openmp-commits
mailing list