Index: runtime/src/include/50/omp.h.var =================================================================== --- runtime/src/include/50/omp.h.var +++ runtime/src/include/50/omp.h.var @@ -92,17 +92,25 @@ extern void __KAI_KMPC_CONVENTION omp_destroy_nest_lock (omp_nest_lock_t *); extern int __KAI_KMPC_CONVENTION omp_test_nest_lock (omp_nest_lock_t *); - /* lock hint type for dynamic user lock */ - typedef enum omp_lock_hint_t { - omp_lock_hint_none = 0, - omp_lock_hint_uncontended = 1, - omp_lock_hint_contended = (1<<1 ), - omp_lock_hint_nonspeculative = (1<<2 ), - omp_lock_hint_speculative = (1<<3 ), + /* OpenMP 5.0 Synchronization hints*/ + typedef enum omp_sync_hint_t { + omp_sync_hint_none = 0, + omp_lock_hint_none = omp_sync_hint_none, + omp_sync_hint_uncontended = 1, + omp_lock_hint_uncontended = omp_sync_hint_uncontended, + omp_sync_hint_contended = (1<<1), + omp_lock_hint_contended = omp_sync_hint_contended, + omp_sync_hint_nonspeculative = (1<<2), + omp_lock_hint_nonspeculative = omp_sync_hint_nonspeculative, + omp_sync_hint_speculative = (1<<3), + omp_lock_hint_speculative = omp_sync_hint_speculative, kmp_lock_hint_hle = (1<<16), kmp_lock_hint_rtm = (1<<17), kmp_lock_hint_adaptive = (1<<18) - } omp_lock_hint_t; + } omp_sync_hint_t; + + /* lock hint type for dynamic user lock */ + typedef omp_sync_hint_t omp_lock_hint_t; /* hinted lock initializers */ extern void __KAI_KMPC_CONVENTION omp_init_lock_with_hint(omp_lock_t *, omp_lock_hint_t); Index: runtime/src/include/50/omp_lib.h.var =================================================================== --- runtime/src/include/50/omp_lib.h.var +++ runtime/src/include/50/omp_lib.h.var @@ -31,8 +31,10 @@ parameter(kmp_size_t_kind=int_ptr_kind()) integer kmp_affinity_mask_kind parameter(kmp_affinity_mask_kind=int_ptr_kind()) + integer omp_sync_hint_kind + parameter(omp_sync_hint_kind=omp_integer_kind) integer omp_lock_hint_kind - parameter(omp_lock_hint_kind=omp_integer_kind) + parameter(omp_lock_hint_kind=omp_sync_hint_kind) integer omp_control_tool_kind parameter(omp_control_tool_kind=omp_integer_kind) integer omp_control_tool_result_kind @@ -71,16 +73,26 @@ integer(kind=omp_proc_bind_kind)omp_proc_bind_spread parameter(omp_proc_bind_spread=4) + integer(kind=omp_sync_hint_kind)omp_sync_hint_none + parameter(omp_sync_hint_none=0) + integer(kind=omp_sync_hint_kind)omp_sync_hint_uncontended + parameter(omp_sync_hint_uncontended=1) + integer(kind=omp_sync_hint_kind)omp_sync_hint_contended + parameter(omp_sync_hint_contended=2) + integer(kind=omp_sync_hint_kind)omp_sync_hint_nonspeculative + parameter(omp_sync_hint_nonspeculative=4) + integer(kind=omp_sync_hint_kind)omp_sync_hint_speculative + parameter(omp_sync_hint_speculative=8) integer(kind=omp_lock_hint_kind)omp_lock_hint_none - parameter(omp_lock_hint_none=0) + parameter(omp_lock_hint_none=omp_sync_hint_none) integer(kind=omp_lock_hint_kind)omp_lock_hint_uncontended - parameter(omp_lock_hint_uncontended=1) + parameter(omp_lock_hint_uncontended=omp_sync_hint_uncontended) integer(kind=omp_lock_hint_kind)omp_lock_hint_contended - parameter(omp_lock_hint_contended=2) + parameter(omp_lock_hint_contended=omp_sync_hint_contended) integer(kind=omp_lock_hint_kind)omp_lock_hint_nonspeculative parameter(omp_lock_hint_nonspeculative=4) integer(kind=omp_lock_hint_kind)omp_lock_hint_speculative - parameter(omp_lock_hint_speculative=8) + parameter(omp_lock_hint_speculative=omp_sync_hint_speculative) integer(kind=omp_lock_hint_kind)kmp_lock_hint_hle parameter(kmp_lock_hint_hle=65536) integer(kind=omp_lock_hint_kind)kmp_lock_hint_rtm @@ -106,15 +118,24 @@ integer(kind=omp_control_tool_result_kind)omp_control_tool_ignored parameter(omp_control_tool_ignored=1) - integer (kind=omp_allocator_kind), parameter :: omp_null_allocator = 0 - integer (kind=omp_allocator_kind), parameter :: omp_default_mem_alloc = 1 - integer (kind=omp_allocator_kind), parameter :: omp_large_cap_mem_alloc = 2 - integer (kind=omp_allocator_kind), parameter :: omp_const_mem_alloc = 3 - integer (kind=omp_allocator_kind), parameter :: omp_high_bw_mem_alloc = 4 - integer (kind=omp_allocator_kind), parameter :: omp_low_lat_mem_alloc = 5 - integer (kind=omp_allocator_kind), parameter :: omp_cgroup_mem_alloc = 6 - integer (kind=omp_allocator_kind), parameter :: omp_pteam_mem_alloc = 7 - integer (kind=omp_allocator_kind), parameter :: omp_thread_mem_alloc = 8 + integer(kind=omp_allocator_kind)omp_null_allocator + parameter(omp_null_allocator=0) + integer(kind=omp_allocator_kind)omp_default_mem_alloc + parameter(omp_default_mem_alloc=1) + integer(kind=omp_allocator_kind)omp_large_cap_mem_alloc + parameter(omp_large_cap_mem_alloc=2) + integer(kind=omp_allocator_kind)omp_const_mem_alloc + parameter(omp_const_mem_alloc=3) + integer(kind=omp_allocator_kind)omp_high_bw_mem_alloc + parameter(omp_high_bw_mem_alloc=4) + integer(kind=omp_allocator_kind)omp_low_lat_mem_alloc + parameter(omp_low_lat_mem_alloc=5) + integer(kind=omp_allocator_kind)omp_cgroup_mem_alloc + parameter(omp_cgroup_mem_alloc=6) + integer(kind=omp_allocator_kind)omp_pteam_mem_alloc + parameter(omp_pteam_mem_alloc=7) + integer(kind=omp_allocator_kind)omp_thread_mem_alloc + parameter(omp_thread_mem_alloc=8) interface Index: runtime/src/include/50/omp_lib.f90.var =================================================================== --- runtime/src/include/50/omp_lib.f90.var +++ runtime/src/include/50/omp_lib.f90.var @@ -27,7 +27,8 @@ integer, parameter :: kmp_size_t_kind = c_size_t integer, parameter :: kmp_affinity_mask_kind = c_intptr_t integer, parameter :: kmp_cancel_kind = omp_integer_kind - integer, parameter :: omp_lock_hint_kind = omp_integer_kind + integer, parameter :: omp_sync_hint_kind = omp_integer_kind + integer, parameter :: omp_lock_hint_kind = omp_sync_hint_kind integer, parameter :: omp_control_tool_kind = omp_integer_kind integer, parameter :: omp_control_tool_result_kind = omp_integer_kind integer, parameter :: omp_allocator_kind = c_intptr_t @@ -62,14 +63,19 @@ integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_sections = 3 integer (kind=kmp_cancel_kind), parameter :: kmp_cancel_taskgroup = 4 - integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = 0 - integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = 1 - integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = 2 - integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = 4 - integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = 8 - integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536 - integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072 - integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144 + integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_none = 0 + integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_uncontended = 1 + integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_contended = 2 + integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_nonspeculative = 4 + integer (kind=omp_sync_hint_kind), parameter :: omp_sync_hint_speculative = 8 + integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_none = omp_sync_hint_none + integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_uncontended = omp_sync_hint_uncontended + integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_contended = omp_sync_hint_contended + integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_nonspeculative = omp_sync_hint_nonspeculative + integer (kind=omp_lock_hint_kind), parameter :: omp_lock_hint_speculative = omp_sync_hint_speculative + integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_hle = 65536 + integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_rtm = 131072 + integer (kind=omp_lock_hint_kind), parameter :: kmp_lock_hint_adaptive = 262144 integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_start = 1 integer (kind=omp_control_tool_kind), parameter :: omp_control_tool_pause = 2 Index: runtime/src/kmp.h =================================================================== --- runtime/src/kmp.h +++ runtime/src/kmp.h @@ -172,34 +172,42 @@ @{ */ -// FIXME DOXYGEN... need to group these flags somehow (Making them an anonymous -// enum would do it...) /*! Values for bit flags used in the ident_t to describe the fields. */ -/*! Use trampoline for internal microtasks */ -#define KMP_IDENT_IMB 0x01 -/*! Use c-style ident structure */ -#define KMP_IDENT_KMPC 0x02 -/* 0x04 is no longer used */ -/*! Entry point generated by auto-parallelization */ -#define KMP_IDENT_AUTOPAR 0x08 -/*! Compiler generates atomic reduction option for kmpc_reduce* */ -#define KMP_IDENT_ATOMIC_REDUCE 0x10 -/*! To mark a 'barrier' directive in user code */ -#define KMP_IDENT_BARRIER_EXPL 0x20 -/*! To Mark implicit barriers. */ -#define KMP_IDENT_BARRIER_IMPL 0x0040 -#define KMP_IDENT_BARRIER_IMPL_MASK 0x01C0 -#define KMP_IDENT_BARRIER_IMPL_FOR 0x0040 -#define KMP_IDENT_BARRIER_IMPL_SECTIONS 0x00C0 - -#define KMP_IDENT_BARRIER_IMPL_SINGLE 0x0140 -#define KMP_IDENT_BARRIER_IMPL_WORKSHARE 0x01C0 - -#define KMP_IDENT_WORK_LOOP 0x200 // static loop -#define KMP_IDENT_WORK_SECTIONS 0x400 // sections -#define KMP_IDENT_WORK_DISTRIBUTE 0x800 // distribute +enum { + /*! Use trampoline for internal microtasks */ + KMP_IDENT_IMB = 0x01, + /*! Use c-style ident structure */ + KMP_IDENT_KMPC = 0x02, + /* 0x04 is no longer used */ + /*! Entry point generated by auto-parallelization */ + KMP_IDENT_AUTOPAR = 0x08, + /*! Compiler generates atomic reduction option for kmpc_reduce* */ + KMP_IDENT_ATOMIC_REDUCE = 0x10, + /*! To mark a 'barrier' directive in user code */ + KMP_IDENT_BARRIER_EXPL = 0x20, + /*! To Mark implicit barriers. */ + KMP_IDENT_BARRIER_IMPL = 0x0040, + KMP_IDENT_BARRIER_IMPL_MASK = 0x01C0, + KMP_IDENT_BARRIER_IMPL_FOR = 0x0040, + KMP_IDENT_BARRIER_IMPL_SECTIONS = 0x00C0, + + KMP_IDENT_BARRIER_IMPL_SINGLE = 0x0140, + KMP_IDENT_BARRIER_IMPL_WORKSHARE = 0x01C0, + + /*! To mark a static loop in OMPT callbacks */ + KMP_IDENT_WORK_LOOP = 0x200, + /*! To mark a sections directive in OMPT callbacks */ + KMP_IDENT_WORK_SECTIONS = 0x400, + /*! To mark a distirbute construct in OMPT callbacks */ + KMP_IDENT_WORK_DISTRIBUTE = 0x800, + /*! Atomic hint; bottom four bits as omp_sync_hint_t. Top four reserved and + not currently used. If one day we need more bits, then we can use + an invalid combination of hints to mean that another, larger field + should be used in a different flag. */ + KMP_IDENT_ATOMIC_HINT_MASK = 0xFF0000, +}; /*! * The ident structure that describes a source location.