From dac87cc0575c53e0771c09dadb3650e61206ebbe Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 1 Sep 2019 18:25:45 +0000 Subject: Update build glue for building libomp. --- lib/libomp/Makefile | 1 - lib/libomp/kmp_config.h | 12 +-- lib/libomp/kmp_i18n_default.inc | 5 +- lib/libomp/kmp_i18n_id.inc | 3 +- lib/libomp/omp-tools.h | 15 ++-- lib/libomp/omp.h | 168 ++++++++++++++++++++++++++++++++-------- 6 files changed, 152 insertions(+), 52 deletions(-) (limited to 'lib/libomp') diff --git a/lib/libomp/Makefile b/lib/libomp/Makefile index 743c319599612..9a209ba1dedb4 100644 --- a/lib/libomp/Makefile +++ b/lib/libomp/Makefile @@ -32,7 +32,6 @@ SRCS+= kmp_settings.cpp SRCS+= kmp_str.cpp SRCS+= kmp_taskdeps.cpp SRCS+= kmp_tasking.cpp -SRCS+= kmp_taskq.cpp SRCS+= kmp_threadprivate.cpp SRCS+= kmp_utility.cpp SRCS+= kmp_version.cpp diff --git a/lib/libomp/kmp_config.h b/lib/libomp/kmp_config.h index 88b79950c04e8..f659e465a6333 100644 --- a/lib/libomp/kmp_config.h +++ b/lib/libomp/kmp_config.h @@ -4,10 +4,9 @@ */ //===----------------------------------------------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.txt for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef KMP_CONFIG_H @@ -66,11 +65,6 @@ #define KMP_LIBRARY_FILE "libomp.so" #define KMP_VERSION_MAJOR 5 #define KMP_VERSION_MINOR 0 -#define LIBOMP_OMP_VERSION 50 -#define OMP_50_ENABLED (LIBOMP_OMP_VERSION >= 50) -#define OMP_45_ENABLED (LIBOMP_OMP_VERSION >= 45) -#define OMP_40_ENABLED (LIBOMP_OMP_VERSION >= 40) -#define OMP_30_ENABLED (LIBOMP_OMP_VERSION >= 30) #define LIBOMP_TSAN_SUPPORT 0 #if LIBOMP_TSAN_SUPPORT #define TSAN_SUPPORT diff --git a/lib/libomp/kmp_i18n_default.inc b/lib/libomp/kmp_i18n_default.inc index 5979352ab8670..1bc4896f183cb 100644 --- a/lib/libomp/kmp_i18n_default.inc +++ b/lib/libomp/kmp_i18n_default.inc @@ -1,6 +1,6 @@ // $FreeBSD$ // Do not edit this file! // -// The file was generated from en_US.txt by message-converter.pl on Thu Mar 14 22:26:24 2019. // +// The file was generated from en_US.txt by message-converter.pl on Fri Aug 23 08:40:57 2019. // static char const * __kmp_i18n_default_meta[] = @@ -362,6 +362,7 @@ __kmp_i18n_default_messages[] = "KMP_HW_SUBSET ignored: too many Procs requested.", "Hierarchy ignored: unsupported level: %1$s.", "OMP: pid %1$s tid %2$s thread %3$s bound to OS proc set {%4$s}", + "%1$s routine deprecated, please use %2$s instead.", NULL }; @@ -412,7 +413,7 @@ __kmp_i18n_sections[] = { 5, __kmp_i18n_default_meta }, { 55, __kmp_i18n_default_strings }, { 6, __kmp_i18n_default_formats }, - { 269, __kmp_i18n_default_messages }, + { 270, __kmp_i18n_default_messages }, { 27, __kmp_i18n_default_hints }, { 0, NULL } }; diff --git a/lib/libomp/kmp_i18n_id.inc b/lib/libomp/kmp_i18n_id.inc index e2355baa0bd3d..51c8eca165710 100644 --- a/lib/libomp/kmp_i18n_id.inc +++ b/lib/libomp/kmp_i18n_id.inc @@ -1,6 +1,6 @@ // $FreeBSD$ // Do not edit this file! // -// The file was generated from en_US.txt by message-converter.pl on Thu Mar 14 22:26:24 2019. // +// The file was generated from en_US.txt by message-converter.pl on Fri Aug 23 08:40:57 2019. // enum kmp_i18n_id { @@ -356,6 +356,7 @@ enum kmp_i18n_id { kmp_i18n_msg_AffHWSubsetManyProcs, kmp_i18n_msg_HierSchedInvalid, kmp_i18n_msg_AffFormatDefault, + kmp_i18n_msg_APIDeprecated, kmp_i18n_msg_last, // Set #5, hints. diff --git a/lib/libomp/omp-tools.h b/lib/libomp/omp-tools.h index ba62e9adda308..8df198507639f 100644 --- a/lib/libomp/omp-tools.h +++ b/lib/libomp/omp-tools.h @@ -1,14 +1,13 @@ // $FreeBSD$ /* - * include/50/omp-tools.h.var + * include/omp-tools.h.var */ //===----------------------------------------------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.txt for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -373,7 +372,7 @@ typedef enum ompt_frame_flag_t { ompt_frame_cfa = 0x10, ompt_frame_framepointer = 0x20, ompt_frame_stackaddress = 0x30 -} ompt_frame_flag_t; +} ompt_frame_flag_t; typedef enum ompt_state_t { ompt_state_work_serial = 0x000, @@ -722,14 +721,14 @@ typedef void (*ompt_callback_dispatch_t) ( ompt_data_t *parallel_data, ompt_data_t *task_data, ompt_dispatch_t kind, - ompt_data_t instance + ompt_data_t instance ); typedef struct ompt_record_dispatch_t { ompt_id_t parallel_id; ompt_id_t task_id; ompt_dispatch_t kind; - ompt_data_t instance; + ompt_data_t instance; } ompt_record_dispatch_t; typedef void (*ompt_callback_task_create_t) ( diff --git a/lib/libomp/omp.h b/lib/libomp/omp.h index d92195b38b9ff..2f48c9821f9f7 100644 --- a/lib/libomp/omp.h +++ b/lib/libomp/omp.h @@ -1,15 +1,14 @@ // $FreeBSD$ /* - * include/50/omp.h.var + * include/omp.h.var */ //===----------------------------------------------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.txt for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -17,6 +16,9 @@ #ifndef __OMP_H # define __OMP_H +# include +# include + # define KMP_VERSION_MAJOR 5 # define KMP_VERSION_MINOR 0 # define KMP_VERSION_BUILD 20140926 @@ -45,10 +47,11 @@ /* schedule kind constants */ typedef enum omp_sched_t { - omp_sched_static = 1, - omp_sched_dynamic = 2, - omp_sched_guided = 3, - omp_sched_auto = 4 + omp_sched_static = 1, + omp_sched_dynamic = 2, + omp_sched_guided = 3, + omp_sched_auto = 4, + omp_sched_monotonic = 0x80000000 } omp_sched_t; /* set API functions */ @@ -135,7 +138,6 @@ extern int __KAI_KMPC_CONVENTION omp_get_team_num (void); extern int __KAI_KMPC_CONVENTION omp_get_cancellation (void); -# include /* OpenMP 4.5 */ extern int __KAI_KMPC_CONVENTION omp_get_initial_device (void); extern void* __KAI_KMPC_CONVENTION omp_target_alloc(size_t, int); @@ -149,6 +151,7 @@ /* OpenMP 5.0 */ extern int __KAI_KMPC_CONVENTION omp_get_device_num (void); + typedef void * omp_depend_t; /* kmp API functions */ extern int __KAI_KMPC_CONVENTION kmp_get_stacksize (void); @@ -219,30 +222,113 @@ omp_control_tool_flush = 3, omp_control_tool_end = 4 } omp_control_tool_t; - + extern int __KAI_KMPC_CONVENTION omp_control_tool(int, int, void*); /* OpenMP 5.0 Memory Management */ - typedef void *omp_allocator_t; - extern __KMP_IMP const omp_allocator_t *OMP_NULL_ALLOCATOR; - extern __KMP_IMP const omp_allocator_t *omp_default_mem_alloc; - extern __KMP_IMP const omp_allocator_t *omp_large_cap_mem_alloc; - extern __KMP_IMP const omp_allocator_t *omp_const_mem_alloc; - extern __KMP_IMP const omp_allocator_t *omp_high_bw_mem_alloc; - extern __KMP_IMP const omp_allocator_t *omp_low_lat_mem_alloc; - extern __KMP_IMP const omp_allocator_t *omp_cgroup_mem_alloc; - extern __KMP_IMP const omp_allocator_t *omp_pteam_mem_alloc; - extern __KMP_IMP const omp_allocator_t *omp_thread_mem_alloc; - - extern void __KAI_KMPC_CONVENTION omp_set_default_allocator(const omp_allocator_t *); - extern const omp_allocator_t * __KAI_KMPC_CONVENTION omp_get_default_allocator(void); -#ifdef __cplusplus - extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, const omp_allocator_t *allocator = OMP_NULL_ALLOCATOR); - extern void __KAI_KMPC_CONVENTION omp_free(void * ptr, const omp_allocator_t *allocator = OMP_NULL_ALLOCATOR); -#else - extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, const omp_allocator_t *allocator); - extern void __KAI_KMPC_CONVENTION omp_free(void *ptr, const omp_allocator_t *allocator); -#endif + typedef uintptr_t omp_uintptr_t; + + typedef enum { + OMP_ATK_THREADMODEL = 1, + OMP_ATK_ALIGNMENT = 2, + OMP_ATK_ACCESS = 3, + OMP_ATK_POOL_SIZE = 4, + OMP_ATK_FALLBACK = 5, + OMP_ATK_FB_DATA = 6, + OMP_ATK_PINNED = 7, + OMP_ATK_PARTITION = 8 + } omp_alloctrait_key_t; + + 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_PRIVATE = 6, + OMP_ATV_ALL = 7, + OMP_ATV_THREAD = 8, + OMP_ATV_PTEAM = 9, + OMP_ATV_CGROUP = 10, + OMP_ATV_DEFAULT_MEM_FB = 11, + OMP_ATV_NULL_FB = 12, + OMP_ATV_ABORT_FB = 13, + OMP_ATV_ALLOCATOR_FB = 14, + OMP_ATV_ENVIRONMENT = 15, + OMP_ATV_NEAREST = 16, + OMP_ATV_BLOCKED = 17, + OMP_ATV_INTERLEAVED = 18 + } omp_alloctrait_value_t; + + typedef struct { + omp_alloctrait_key_t key; + omp_uintptr_t value; + } omp_alloctrait_t; + +# if defined(_WIN32) + // On Windows cl and icl do not support 64-bit enum, let's use integer then. + typedef omp_uintptr_t omp_allocator_handle_t; + extern __KMP_IMP omp_allocator_handle_t const omp_null_allocator; + extern __KMP_IMP omp_allocator_handle_t const omp_default_mem_alloc; + extern __KMP_IMP omp_allocator_handle_t const omp_large_cap_mem_alloc; + extern __KMP_IMP omp_allocator_handle_t const omp_const_mem_alloc; + extern __KMP_IMP omp_allocator_handle_t const omp_high_bw_mem_alloc; + extern __KMP_IMP omp_allocator_handle_t const omp_low_lat_mem_alloc; + extern __KMP_IMP omp_allocator_handle_t const omp_cgroup_mem_alloc; + extern __KMP_IMP omp_allocator_handle_t const omp_pteam_mem_alloc; + extern __KMP_IMP omp_allocator_handle_t const omp_thread_mem_alloc; + typedef omp_uintptr_t omp_memspace_handle_t; + extern __KMP_IMP omp_memspace_handle_t const omp_default_mem_space; + extern __KMP_IMP omp_memspace_handle_t const omp_large_cap_mem_space; + extern __KMP_IMP omp_memspace_handle_t const omp_const_mem_space; + extern __KMP_IMP omp_memspace_handle_t const omp_high_bw_mem_space; + extern __KMP_IMP omp_memspace_handle_t const omp_low_lat_mem_space; +# else +# if __cplusplus >= 201103 + typedef enum omp_allocator_handle_t : omp_uintptr_t +# else + typedef enum omp_allocator_handle_t +# endif + { + omp_null_allocator = 0, + omp_default_mem_alloc = 1, + omp_large_cap_mem_alloc = 2, + omp_const_mem_alloc = 3, + omp_high_bw_mem_alloc = 4, + omp_low_lat_mem_alloc = 5, + omp_cgroup_mem_alloc = 6, + omp_pteam_mem_alloc = 7, + omp_thread_mem_alloc = 8, + KMP_ALLOCATOR_MAX_HANDLE = UINTPTR_MAX + } omp_allocator_handle_t; +# if __cplusplus >= 201103 + typedef enum omp_memspace_handle_t : omp_uintptr_t +# else + typedef enum omp_memspace_handle_t +# endif + { + omp_default_mem_space = 0, + omp_large_cap_mem_space = 1, + omp_const_mem_space = 2, + omp_high_bw_mem_space = 3, + omp_low_lat_mem_space = 4, + KMP_MEMSPACE_MAX_HANDLE = UINTPTR_MAX + } omp_memspace_handle_t; +# endif + extern omp_allocator_handle_t __KAI_KMPC_CONVENTION omp_init_allocator(omp_memspace_handle_t m, + int ntraits, omp_alloctrait_t traits[]); + extern void __KAI_KMPC_CONVENTION omp_destroy_allocator(omp_allocator_handle_t allocator); + + extern void __KAI_KMPC_CONVENTION omp_set_default_allocator(omp_allocator_handle_t a); + extern omp_allocator_handle_t __KAI_KMPC_CONVENTION omp_get_default_allocator(void); +# ifdef __cplusplus + extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a = omp_null_allocator); + extern void __KAI_KMPC_CONVENTION omp_free(void * ptr, omp_allocator_handle_t a = omp_null_allocator); +# else + extern void *__KAI_KMPC_CONVENTION omp_alloc(size_t size, omp_allocator_handle_t a); + extern void __KAI_KMPC_CONVENTION omp_free(void *ptr, omp_allocator_handle_t a); +# endif /* OpenMP 5.0 Affinity Format */ extern void __KAI_KMPC_CONVENTION omp_set_affinity_format(char const *); @@ -250,6 +336,26 @@ extern void __KAI_KMPC_CONVENTION omp_display_affinity(char const *); extern size_t __KAI_KMPC_CONVENTION omp_capture_affinity(char *, size_t, char const *); + /* OpenMP 5.0 events */ +# if defined(_WIN32) + // On Windows cl and icl do not support 64-bit enum, let's use integer then. + typedef omp_uintptr_t omp_event_handle_t; +# else + typedef enum omp_event_handle_t { KMP_EVENT_MAX_HANDLE = UINTPTR_MAX } omp_event_handle_t; +# endif + extern void __KAI_KMPC_CONVENTION omp_fulfill_event ( omp_event_handle_t event ); + + /* OpenMP 5.0 Pause Resources */ + typedef enum omp_pause_resource_t { + omp_pause_resume = 0, + omp_pause_soft = 1, + omp_pause_hard = 2 + } omp_pause_resource_t; + extern int __KAI_KMPC_CONVENTION omp_pause_resource(omp_pause_resource_t, int); + extern int __KAI_KMPC_CONVENTION omp_pause_resource_all(omp_pause_resource_t); + + extern int __KAI_KMPC_CONVENTION omp_get_supported_active_levels(void); + # undef __KAI_KMPC_CONVENTION # undef __KMP_IMP -- cgit v1.3