[Openmp-commits] [PATCH] D102883: [OpenMP] Define named constants for interop's foreign runtime ID

Hansang Bae via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu May 20 16:09:37 PDT 2021


hbae created this revision.
hbae added reviewers: AndreyChurbanov, tlwilmar, jlpeyton, Nawrin.
hbae added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
hbae requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

Also added missing Fortran definitions for interop support.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102883

Files:
  openmp/runtime/src/include/omp.h.var
  openmp/runtime/src/include/omp_lib.f90.var
  openmp/runtime/src/include/omp_lib.h.var


Index: openmp/runtime/src/include/omp_lib.h.var
===================================================================
--- openmp/runtime/src/include/omp_lib.h.var
+++ openmp/runtime/src/include/omp_lib.h.var
@@ -52,6 +52,10 @@
       parameter(omp_depend_kind=int_ptr_kind())
       integer omp_event_handle_kind
       parameter(omp_event_handle_kind=int_ptr_kind())
+      integer omp_interop_kind
+      parameter(omp_interop_kind=int_ptr_kind())
+      integer omp_interop_fr_kind
+      parameter(omp_interop_fr_kind=omp_integer_kind)
 
       integer(kind=omp_integer_kind)openmp_version
       parameter(openmp_version=@LIBOMP_OMP_YEAR_MONTH@)
@@ -247,6 +251,24 @@
       integer(kind=omp_pause_resource_kind)omp_pause_hard
       parameter(omp_pause_hard=2)
 
+      integer(kind=omp_interop_fr_kind)omp_ifr_cuda
+      parameter(omp_ifr_cuda=1)
+      integer(kind=omp_interop_fr_kind)omp_ifr_cuda_driver
+      parameter(omp_ifr_cuda_driver=2)
+      integer(kind=omp_interop_fr_kind)omp_ifr_opencl
+      parameter(omp_ifr_opencl=3)
+      integer(kind=omp_interop_fr_kind)omp_ifr_sycl
+      parameter(omp_ifr_sycl=4)
+      integer(kind=omp_interop_fr_kind)omp_ifr_hip
+      parameter(omp_ifr_hip=5)
+      integer(kind=omp_interop_fr_kind)omp_ifr_level_zero
+      parameter(omp_ifr_level_zero=6)
+      integer(kind=omp_interop_fr_kind)omp_ifr_last
+      parameter(omp_ifr_last=7)
+
+      integer(kind=omp_interop_kind)omp_interop_none
+      parameter(omp_interop_none=0)
+
       interface
 
 !       ***
Index: openmp/runtime/src/include/omp_lib.f90.var
===================================================================
--- openmp/runtime/src/include/omp_lib.f90.var
+++ openmp/runtime/src/include/omp_lib.f90.var
@@ -34,6 +34,8 @@
         integer, parameter :: omp_memspace_handle_kind = c_intptr_t
         integer, parameter :: omp_alloctrait_key_kind = omp_integer_kind
         integer, parameter :: omp_alloctrait_val_kind = c_intptr_t
+        integer, parameter :: omp_interop_kind = c_intptr_t
+        integer, parameter :: omp_interop_fr_kind = omp_integer_kind
 
         type omp_alloctrait
           integer(kind=omp_alloctrait_key_kind) key
@@ -156,6 +158,16 @@
         integer (kind=omp_pause_resource_kind), parameter :: omp_pause_soft = 1
         integer (kind=omp_pause_resource_kind), parameter :: omp_pause_hard = 2
 
+        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_cuda = 1
+        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_cuda_driver = 2
+        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_opencl = 3
+        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_sycl = 4
+        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_hip = 5
+        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_level_zero = 6
+        integer (kind=omp_interop_fr_kind), parameter :: omp_ifr_last = 7
+
+        integer (kind=omp_interop_kind), parameter :: omp_interop_none = 0
+
         interface
 
 !         ***
Index: openmp/runtime/src/include/omp.h.var
===================================================================
--- openmp/runtime/src/include/omp.h.var
+++ openmp/runtime/src/include/omp.h.var
@@ -182,6 +182,16 @@
         omp_irc_other = -6
     } omp_interop_rc_t;
 
+    typedef enum omp_interop_fr {
+        omp_ifr_cuda = 1,
+        omp_ifr_cuda_driver = 2,
+        omp_ifr_opencl = 3,
+        omp_ifr_sycl = 4,
+        omp_ifr_hip = 5,
+        omp_ifr_level_zero = 6,
+        omp_ifr_last = 7
+    } omp_interop_fr_t;
+
     typedef void * omp_interop_t;
 
     /*!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102883.346880.patch
Type: text/x-patch
Size: 3599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210520/76c26d18/attachment-0001.bin>


More information about the Openmp-commits mailing list