openmp: Change omp_atv_default value and rename omp_atv_sequential to omp_atv_serialized.
authorJakub Jelinek <jakub@redhat.com>
Thu, 9 Jul 2020 09:29:30 +0000 (11:29 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 9 Jul 2020 09:29:30 +0000 (11:29 +0200)
While this is an OpenMP 5.1 change, it is undesirable to let people use different
values and then deal with ABI backwards compatibility in a year or two.

2020-07-09  Jakub Jelinek  <jakub@redhat.com>

* omp.h.in (omp_alloctrait_value_t): Change omp_atv_default from
2 to -1.  Add omp_atv_serialized and define omp_atv_sequential using
it.  Remove __omp_alloctrait_value_max__.
* allocator.c (omp_init_allocator): Handle omp_atv_default for
omp_atk_alignment and omp_atk_pool_size.

libgomp/allocator.c
libgomp/omp.h.in

index 4e293992d226145d58e9e75c52875f6f566d6579..76feba71082ccc62d57a87350dd258b10f7c0fc9 100644 (file)
@@ -90,6 +90,11 @@ omp_init_allocator (omp_memspace_handle_t memspace, int ntraits,
          }
        break;
       case omp_atk_alignment:
+        if (traits[i].value == omp_atv_default)
+         {
+           data.alignment = 1;
+           break;
+         }
        if ((traits[i].value & (traits[i].value - 1)) != 0
            || !traits[i].value)
          return omp_null_allocator;
@@ -112,7 +117,10 @@ omp_init_allocator (omp_memspace_handle_t memspace, int ntraits,
          }
        break;
       case omp_atk_pool_size:
-       data.pool_size = traits[i].value;
+       if (traits[i].value == omp_atv_default)
+         data.pool_size = ~(uintptr_t) 0;
+       else
+         data.pool_size = traits[i].value;
        break;
       case omp_atk_fallback:
        switch (traits[i].value)
index e2db33e005f88a6efb65b467ea5a13f743799e9c..57af73720f1d640ba976c0faf38d7025f1baae04 100644 (file)
@@ -136,12 +136,13 @@ typedef enum omp_alloctrait_key_t
 
 typedef enum omp_alloctrait_value_t
 {
+  omp_atv_default = (__UINTPTR_TYPE__) -1,
   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,
   omp_atv_private = 6,
   omp_atv_all = 7,
   omp_atv_thread = 8,
@@ -154,8 +155,7 @@ typedef enum omp_alloctrait_value_t
   omp_atv_environment = 15,
   omp_atv_nearest = 16,
   omp_atv_blocked = 17,
-  omp_atv_interleaved = 18,
-  __omp_alloctrait_value_max__ = __UINTPTR_MAX__
+  omp_atv_interleaved = 18
 } omp_alloctrait_value_t;
 
 typedef struct omp_alloctrait_t