[llvm-branch-commits] [openmp] 6f0f022 - [OpenMP] Update allocator trait key/value definitions

Hansang Bae via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 12 18:26:13 PST 2021


Author: Hansang Bae
Date: 2021-01-12T20:09:45-06:00
New Revision: 6f0f0220380f83e8f3bf9832ffa795e9965fda2d

URL: https://github.com/llvm/llvm-project/commit/6f0f0220380f83e8f3bf9832ffa795e9965fda2d
DIFF: https://github.com/llvm/llvm-project/commit/6f0f0220380f83e8f3bf9832ffa795e9965fda2d.diff

LOG: [OpenMP] Update allocator trait key/value definitions

Use new definitions introduced in 5.1 specification.

Differential Revision: https://reviews.llvm.org/D94277

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
    openmp/runtime/src/kmp.h
    openmp/runtime/src/kmp_alloc.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/include/omp.h.var b/openmp/runtime/src/include/omp.h.var
index 8821377e29d8..4d055f905bcb 100644
--- a/openmp/runtime/src/include/omp.h.var
+++ b/openmp/runtime/src/include/omp.h.var
@@ -307,7 +307,7 @@
     typedef uintptr_t omp_uintptr_t;
 
     typedef enum {
-        omp_atk_threadmodel = 1,
+        omp_atk_sync_hint = 1,
         omp_atk_alignment = 2,
         omp_atk_access = 3,
         omp_atk_pool_size = 4,
@@ -320,10 +320,10 @@
     typedef enum {
         omp_atv_false = 0,
         omp_atv_true = 1,
-        omp_atv_default = 2,
         omp_atv_contended = 3,
         omp_atv_uncontended = 4,
-        omp_atv_sequential = 5,
+        omp_atv_serialized = 5,
+        omp_atv_sequential = omp_atv_serialized, // (deprecated)
         omp_atv_private = 6,
         omp_atv_all = 7,
         omp_atv_thread = 8,
@@ -338,6 +338,7 @@
         omp_atv_blocked = 17,
         omp_atv_interleaved = 18
     } omp_alloctrait_value_t;
+    #define omp_atv_default ((omp_uintptr_t)-1)
 
     typedef struct {
         omp_alloctrait_key_t key;

diff  --git a/openmp/runtime/src/include/omp_lib.f90.var b/openmp/runtime/src/include/omp_lib.f90.var
index 24f8a2af4c5e..2fc8d7c3daa4 100644
--- a/openmp/runtime/src/include/omp_lib.f90.var
+++ b/openmp/runtime/src/include/omp_lib.f90.var
@@ -98,7 +98,7 @@
         integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_success = 0
         integer (kind=omp_control_tool_result_kind), parameter :: omp_control_tool_ignored = 1
 
-        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_threadmodel = 1
+        integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_sync_hint = 1
         integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_alignment = 2
         integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_access = 3
         integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pool_size = 4
@@ -107,12 +107,13 @@
         integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_pinned = 7
         integer (kind=omp_alloctrait_key_kind), parameter :: omp_atk_partition = 8
 
+        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default = -1
         integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_false = 0
         integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_true = 1
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_default = 2
         integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_contended = 3
         integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_uncontended = 4
-        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_sequential = 5
+        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_serialized = 5
+        integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_sequential = omp_atv_serialized
         integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_private = 6
         integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_all = 7
         integer (kind=omp_alloctrait_val_kind), parameter :: omp_atv_thread = 8

diff  --git a/openmp/runtime/src/include/omp_lib.h.var b/openmp/runtime/src/include/omp_lib.h.var
index 05140b04f273..3fb2d25b15f1 100644
--- a/openmp/runtime/src/include/omp_lib.h.var
+++ b/openmp/runtime/src/include/omp_lib.h.var
@@ -131,8 +131,8 @@
       integer(omp_control_tool_result_kind)omp_control_tool_ignored
       parameter(omp_control_tool_ignored=1)
 
-      integer(kind=omp_alloctrait_key_kind)omp_atk_threadmodel
-      parameter(omp_atk_threadmodel=1)
+      integer(kind=omp_alloctrait_key_kind)omp_atk_sync_hint
+      parameter(omp_atk_sync_hint=1)
       integer(kind=omp_alloctrait_key_kind)omp_atk_alignment
       parameter(omp_atk_alignment=2)
       integer(kind=omp_alloctrait_key_kind)omp_atk_access
@@ -148,18 +148,20 @@
       integer(kind=omp_alloctrait_key_kind)omp_atk_partition
       parameter(omp_atk_partition=8)
 
+      integer(kind=omp_alloctrait_val_kind)omp_atv_default
+      parameter(omp_atv_default=-1)
       ! Reserved for future use
       integer(kind=omp_alloctrait_val_kind)omp_atv_false
       parameter(omp_atv_false=0)
       ! Reserved for future use
       integer(kind=omp_alloctrait_val_kind)omp_atv_true
       parameter(omp_atv_true=1)
-      integer(kind=omp_alloctrait_val_kind)omp_atv_default
-      parameter(omp_atv_default=2)
       integer(kind=omp_alloctrait_val_kind)omp_atv_contended
       parameter(omp_atv_contended=3)
       integer(kind=omp_alloctrait_val_kind)omp_atv_uncontended
       parameter(omp_atv_uncontended=4)
+      integer(kind=omp_alloctrait_val_kind)omp_atv_serialized
+      parameter(omp_atv_serialized=5)
       integer(kind=omp_alloctrait_val_kind)omp_atv_sequential
       parameter(omp_atv_sequential=5)
       integer(kind=omp_alloctrait_val_kind)omp_atv_private

diff  --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index de83ec0eccff..983511042fa7 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -890,7 +890,7 @@ extern int __kmp_hws_abs_flag; // absolute or per-item number requested
 typedef uintptr_t omp_uintptr_t;
 
 typedef enum {
-  omp_atk_threadmodel = 1,
+  omp_atk_sync_hint = 1,
   omp_atk_alignment = 2,
   omp_atk_access = 3,
   omp_atk_pool_size = 4,
@@ -903,10 +903,10 @@ typedef enum {
 typedef enum {
   omp_atv_false = 0,
   omp_atv_true = 1,
-  omp_atv_default = 2,
   omp_atv_contended = 3,
   omp_atv_uncontended = 4,
-  omp_atv_sequential = 5,
+  omp_atv_serialized = 5,
+  omp_atv_sequential = omp_atv_serialized, // (deprecated)
   omp_atv_private = 6,
   omp_atv_all = 7,
   omp_atv_thread = 8,
@@ -921,6 +921,7 @@ typedef enum {
   omp_atv_blocked = 17,
   omp_atv_interleaved = 18
 } omp_alloctrait_value_t;
+#define omp_atv_default ((omp_uintptr_t)-1)
 
 typedef void *omp_memspace_handle_t;
 extern omp_memspace_handle_t const omp_default_mem_space;

diff  --git a/openmp/runtime/src/kmp_alloc.cpp b/openmp/runtime/src/kmp_alloc.cpp
index 4311bf8c9058..b56e71881208 100644
--- a/openmp/runtime/src/kmp_alloc.cpp
+++ b/openmp/runtime/src/kmp_alloc.cpp
@@ -1348,7 +1348,7 @@ omp_allocator_handle_t __kmpc_init_allocator(int gtid, omp_memspace_handle_t ms,
   al->memspace = ms; // not used currently
   for (i = 0; i < ntraits; ++i) {
     switch (traits[i].key) {
-    case omp_atk_threadmodel:
+    case omp_atk_sync_hint:
     case omp_atk_access:
     case omp_atk_pinned:
       break;


        


More information about the llvm-branch-commits mailing list