[Openmp-commits] [llvm] [openmp] [OFFLOAD][OPENMP] 6.0 compatible interop interface (PR #143491)

Kevin Sala Penades via Openmp-commits openmp-commits at lists.llvm.org
Wed Jul 16 11:16:36 PDT 2025


================
@@ -1342,6 +1358,45 @@ struct GenericPluginTy {
   int32_t get_function(__tgt_device_binary Binary, const char *Name,
                        void **KernelPtr);
 
+  /// Return the interop specification that the plugin supports
+  /// It might not be one of the user specified ones.
+  interop_spec_t select_interop_preference(int32_t ID, int32_t InteropType,
+                                           int32_t NumPrefers,
+                                           interop_spec_t *Prefers) {
+    auto &Device = getDevice(ID);
+    return Device.selectInteropPreference(InteropType, NumPrefers, Prefers);
+  }
+
+  /// Create OpenMP interop with the given interop context
+  omp_interop_val_t *create_interop(int32_t ID, int32_t InteropContext,
+                                    interop_spec_t *InteropSpec) {
+    auto &Device = getDevice(ID);
+    return Device.createInterop(InteropContext, *InteropSpec);
+  }
+
+  /// Release OpenMP interop object
+  int32_t release_interop(int32_t ID, omp_interop_val_t *Interop) {
----------------
kevinsala wrote:

Please add asserts checking the interop pointers at this level.

https://github.com/llvm/llvm-project/pull/143491


More information about the Openmp-commits mailing list