[llvm] [OpenMP] Add test to print interop identifiers (PR #161434)
Alex Duran via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 2 02:33:58 PDT 2025
================
@@ -0,0 +1,69 @@
+// RUN: %libomptarget-compile-amdgcn-amd-amdhsa
+// RUN: %libomptarget-run-generic 2>&1 | \
+// RUN: %fcheck-generic -check-prefix=AMDCHECK
+
+// REQUIRES: amdgpu
+
+#include <omp.h>
+#include <stdio.h>
+
+const char *interop_int_to_string(const int interop_int) {
+ switch (interop_int) {
+ case 1:
+ return "cuda";
+ case 2:
+ return "cuda_driver";
+ case 3:
+ return "opencl";
+ case 4:
+ return "sycl";
+ case 5:
+ return "hip";
+ case 6:
+ return "level_zero";
+ case 7:
+ return "hsa";
+ default:
+ return "unknown";
+ }
+}
+
+int main(int argc, char **argv) {
+ omp_interop_t iobj = omp_interop_none;
+#pragma omp interop init(targetsync : iobj)
----------------
adurang wrote:
Given the usage in this test, I think it should of type **target** not **targetsync**:
```suggestion
#pragma omp interop init(target : iobj)
```
https://github.com/llvm/llvm-project/pull/161434
More information about the llvm-commits
mailing list