[Openmp-commits] [openmp] cf5c94e - [OpenMP] Define named constants for interop's foreign runtime ID
Hansang Bae via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jun 1 11:07:21 PDT 2021
Author: Hansang Bae
Date: 2021-06-01T13:06:59-05:00
New Revision: cf5c94ef08f97a6ce16ffb0b02b4b9b130f0c1fc
URL: https://github.com/llvm/llvm-project/commit/cf5c94ef08f97a6ce16ffb0b02b4b9b130f0c1fc
DIFF: https://github.com/llvm/llvm-project/commit/cf5c94ef08f97a6ce16ffb0b02b4b9b130f0c1fc.diff
LOG: [OpenMP] Define named constants for interop's foreign runtime ID
Also added missing Fortran definitions for interop support.
Differential Revision: https://reviews.llvm.org/D102883
Added:
Modified:
openmp/runtime/src/include/omp.h.var
openmp/runtime/src/include/omp_lib.f90.var
openmp/runtime/src/include/omp_lib.h.var
Removed:
################################################################################
diff --git a/openmp/runtime/src/include/omp.h.var b/openmp/runtime/src/include/omp.h.var
index 804aa01389dd1..588c52b02a8f6 100644
--- a/openmp/runtime/src/include/omp.h.var
+++ b/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;
/*!
@@ -211,7 +221,7 @@
/*!
* The `omp_get_interop_rc_desc` routine retrieves a description of the return code associated with an `omp_interop_t` object.
*/
- extern const char * __KAI_KMPC_CONVENTION omp_get_interop_rc_desc(const omp_interop_rc_t, omp_interop_rc_t);
+ extern const char * __KAI_KMPC_CONVENTION omp_get_interop_rc_desc(const omp_interop_t, omp_interop_rc_t);
/* OpenMP 5.1 device memory routines */
diff --git a/openmp/runtime/src/include/omp_lib.f90.var b/openmp/runtime/src/include/omp_lib.f90.var
index 7763e5dca14ce..48622e2154c02 100644
--- a/openmp/runtime/src/include/omp_lib.f90.var
+++ b/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
! ***
diff --git a/openmp/runtime/src/include/omp_lib.h.var b/openmp/runtime/src/include/omp_lib.h.var
index 7496c038162f2..9122fb26613eb 100644
--- a/openmp/runtime/src/include/omp_lib.h.var
+++ b/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
! ***
More information about the Openmp-commits
mailing list