[Openmp-commits] [PATCH] D93429: [OpenMP] Add definitions for 5.1 interop to omp.h
Hansang Bae via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Dec 17 08:26:41 PST 2020
hbae updated this revision to Diff 312514.
hbae added a comment.
Copied summary of the interop routines from the spec.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93429/new/
https://reviews.llvm.org/D93429
Files:
openmp/runtime/src/include/omp.h.var
Index: openmp/runtime/src/include/omp.h.var
===================================================================
--- openmp/runtime/src/include/omp.h.var
+++ openmp/runtime/src/include/omp.h.var
@@ -152,6 +152,67 @@
extern int __KAI_KMPC_CONVENTION omp_get_device_num (void);
typedef void * omp_depend_t;
+ /* OpenMP 5.1 interop */
+ typedef intptr_t omp_intptr_t;
+
+ /* 0..omp_get_num_interop_properties()-1 are reserved for implementation-defined properties */
+ typedef enum omp_interop_property {
+ omp_ipr_fr_id = -1,
+ omp_ipr_fr_name = -2,
+ omp_ipr_vendor = -3,
+ omp_ipr_vendor_name = -4,
+ omp_ipr_device_num = -5,
+ omp_ipr_platform = -6,
+ omp_ipr_device = -7,
+ omp_ipr_device_context = -8,
+ omp_ipr_targetsync = -9,
+ omp_ipr_first = -9
+ } omp_interop_property_t;
+
+ #define omp_interop_none 0
+
+ typedef enum omp_interop_rc {
+ omp_irc_no_value = 1,
+ omp_irc_success = 0,
+ omp_irc_empty = -1,
+ omp_irc_out_of_range = -2,
+ omp_irc_type_int = -3,
+ omp_irc_type_ptr = -4,
+ omp_irc_type_str = -5,
+ omp_irc_other = -6
+ } omp_interop_rc_t;
+
+ typedef void * omp_interop_t;
+
+ /*!
+ * The `omp_get_num_interop_properties` routine retrieves the number of implementation-defined properties available for an `omp_interop_t` object.
+ */
+ extern int __KAI_KMPC_CONVENTION omp_get_num_interop_properties(const omp_interop_t);
+ /*!
+ * The `omp_get_interop_int` routine retrieves an integer property from an `omp_interop_t` object.
+ */
+ extern omp_intptr_t __KAI_KMPC_CONVENTION omp_get_interop_int(const omp_interop_t, omp_interop_property_t, int *);
+ /*!
+ * The `omp_get_interop_ptr` routine retrieves a pointer property from an `omp_interop_t` object.
+ */
+ extern void * __KAI_KMPC_CONVENTION omp_get_interop_ptr(const omp_interop_t, omp_interop_property_t, int *);
+ /*!
+ * The `omp_get_interop_str` routine retrieves a string property from an `omp_interop_t` object.
+ */
+ extern const char * __KAI_KMPC_CONVENTION omp_get_interop_str(const omp_interop_t, omp_interop_property_t, int *);
+ /*!
+ * The `omp_get_interop_name` routine retrieves a property name from an `omp_interop_t` object.
+ */
+ extern const char * __KAI_KMPC_CONVENTION omp_get_interop_name(const omp_interop_t, omp_interop_property_t);
+ /*!
+ * The `omp_get_interop_type_desc` routine retrieves a description of the type of a property associated with an `omp_interop_t` object.
+ */
+ extern const char * __KAI_KMPC_CONVENTION omp_get_interop_type_desc(const omp_interop_t, omp_interop_property_t);
+ /*!
+ * 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);
+
/* kmp API functions */
extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void);
extern void __KAI_KMPC_CONVENTION kmp_set_stacksize (int);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93429.312514.patch
Type: text/x-patch
Size: 3224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20201217/6fff3029/attachment-0001.bin>
More information about the Openmp-commits
mailing list