LLVM OpenMP 19.0.0git
kmp_version.cpp
Go to the documentation of this file.
1/*
2 * kmp_version.cpp
3 */
4
5//===----------------------------------------------------------------------===//
6//
7// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
8// See https://llvm.org/LICENSE.txt for license information.
9// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
10//
11//===----------------------------------------------------------------------===//
12
13#include "kmp.h"
14#include "kmp_io.h"
15#include "kmp_version.h"
16
17// Replace with snapshot date YYYYMMDD for promotion build.
18#define KMP_VERSION_BUILD 20140926
19
20// Helper macros to convert value of macro to string literal.
21#define _stringer(x) #x
22#define stringer(x) _stringer(x)
23
24// Detect compiler.
25#if KMP_COMPILER_ICX
26#define KMP_COMPILER __VERSION__
27#elif KMP_COMPILER_ICC
28#if __INTEL_COMPILER == 1010
29#define KMP_COMPILER "Intel(R) C++ Compiler 10.1"
30#elif __INTEL_COMPILER == 1100
31#define KMP_COMPILER "Intel(R) C++ Compiler 11.0"
32#elif __INTEL_COMPILER == 1110
33#define KMP_COMPILER "Intel(R) C++ Compiler 11.1"
34#elif __INTEL_COMPILER == 1200
35#define KMP_COMPILER "Intel(R) C++ Compiler 12.0"
36#elif __INTEL_COMPILER == 1210
37#define KMP_COMPILER "Intel(R) C++ Compiler 12.1"
38#elif __INTEL_COMPILER == 1300
39#define KMP_COMPILER "Intel(R) C++ Compiler 13.0"
40#elif __INTEL_COMPILER == 1310
41#define KMP_COMPILER "Intel(R) C++ Compiler 13.1"
42#elif __INTEL_COMPILER == 1400
43#define KMP_COMPILER "Intel(R) C++ Compiler 14.0"
44#elif __INTEL_COMPILER == 1410
45#define KMP_COMPILER "Intel(R) C++ Compiler 14.1"
46#elif __INTEL_COMPILER == 1500
47#define KMP_COMPILER "Intel(R) C++ Compiler 15.0"
48#elif __INTEL_COMPILER == 1600
49#define KMP_COMPILER "Intel(R) C++ Compiler 16.0"
50#elif __INTEL_COMPILER == 1700
51#define KMP_COMPILER "Intel(R) C++ Compiler 17.0"
52#elif __INTEL_COMPILER == 1800
53#define KMP_COMPILER "Intel(R) C++ Compiler 18.0"
54#elif __INTEL_COMPILER == 1900
55#define KMP_COMPILER "Intel(R) C++ Compiler 19.0"
56#elif __INTEL_COMPILER == 1910
57#define KMP_COMPILER "Intel(R) C++ Compiler 19.1"
58#elif __INTEL_COMPILER > 1910
59#define KMP_COMPILER \
60 "Intel(R) C++ Compiler Classic " stringer(__INTEL_COMPILER) "." stringer( \
61 __INTEL_COMPILER_UPDATE)
62#endif
63#elif KMP_COMPILER_CLANG
64#define KMP_COMPILER \
65 "Clang " stringer(__clang_major__) "." stringer(__clang_minor__)
66#elif KMP_COMPILER_GCC
67#define KMP_COMPILER "GCC " stringer(__GNUC__) "." stringer(__GNUC_MINOR__)
68#elif KMP_COMPILER_MSVC
69#define KMP_COMPILER "MSVC " stringer(_MSC_FULL_VER)
70#endif
71#ifndef KMP_COMPILER
72#warning "Unknown compiler"
73#define KMP_COMPILER "unknown compiler"
74#endif
75
76// Detect librray type (perf, stub).
77#ifdef KMP_STUB
78#define KMP_LIB_TYPE "stub"
79#else
80#define KMP_LIB_TYPE "performance"
81#endif // KMP_LIB_TYPE
82
83// Detect link type (static, dynamic).
84#if KMP_DYNAMIC_LIB
85#define KMP_LINK_TYPE "dynamic"
86#else
87#define KMP_LINK_TYPE "static"
88#endif // KMP_LINK_TYPE
89
90// Finally, define strings.
91#define KMP_LIBRARY KMP_LIB_TYPE " library (" KMP_LINK_TYPE ")"
92#define KMP_COPYRIGHT ""
93
94int const __kmp_version_major = KMP_VERSION_MAJOR;
97int const __kmp_openmp_version = 201611;
98
99/* Do NOT change the format of this string! Intel(R) Thread Profiler checks for
100 a specific format some changes in the recognition routine there need to be
101 made before this is changed. */
103 " ver. " stringer(KMP_VERSION_MAJOR) "." stringer(
105
108 KMP_VERSION_PREFIX "version: " stringer(KMP_VERSION_MAJOR) "." stringer(
111 KMP_VERSION_PREFIX "library type: " KMP_LIB_TYPE;
113 KMP_VERSION_PREFIX "link type: " KMP_LINK_TYPE;
114char const __kmp_version_build_time[] = KMP_VERSION_PREFIX "build time: "
115 "no_timestamp";
116#if KMP_MIC2
117char const __kmp_version_target_env[] =
118 KMP_VERSION_PREFIX "target environment: MIC2";
119#endif
121 KMP_VERSION_PREFIX "build compiler: " KMP_COMPILER;
122
123// Called at serial initialization time.
125
128 return;
129 }
131
132#ifndef KMP_STUB
133 kmp_str_buf_t buffer;
134 __kmp_str_buf_init(&buffer);
135 // Print version strings skipping initial magic.
136 __kmp_str_buf_print(&buffer, "%s\n",
138 __kmp_str_buf_print(&buffer, "%s\n",
140 __kmp_str_buf_print(&buffer, "%s\n",
142 __kmp_str_buf_print(&buffer, "%s\n",
144#if KMP_MIC
145 __kmp_str_buf_print(&buffer, "%s\n",
147#endif
148 __kmp_str_buf_print(&buffer, "%s\n",
150#if defined(KMP_GOMP_COMPAT)
151 __kmp_str_buf_print(&buffer, "%s\n",
153#endif /* defined(KMP_GOMP_COMPAT) */
154 __kmp_str_buf_print(&buffer, "%s\n",
156 __kmp_str_buf_print(&buffer, "%sdynamic error checking: %s\n",
158 (__kmp_env_consistency_check ? "yes" : "no"));
159#ifdef KMP_DEBUG
160 for (int i = bs_plain_barrier; i < bs_last_barrier; ++i) {
162 &buffer, "%s%s barrier branch bits: gather=%u, release=%u\n",
165 __kmp_barrier_release_branch_bits[i]); // __kmp_str_buf_print
166 }
167 for (int i = bs_plain_barrier; i < bs_last_barrier; ++i) {
169 &buffer, "%s%s barrier pattern: gather=%s, release=%s\n",
173 [__kmp_barrier_release_pattern[i]]); // __kmp_str_buf_print
174 }
175 __kmp_str_buf_print(&buffer, "%s\n",
177#endif
179 &buffer, "%sthread affinity support: %s\n", KMP_VERSION_PREF_STR,
181 (KMP_AFFINITY_CAPABLE()
182 ? (__kmp_affinity.type == affinity_none ? "not used" : "yes")
183 : "no")
184#else
185 "no"
186#endif
187 );
188 __kmp_printf("%s", buffer.str);
189 __kmp_str_buf_free(&buffer);
190 K_DIAG(1, ("KMP_VERSION is true\n"));
191#endif // KMP_STUB
192} // __kmp_print_version_1
193
194// Called at parallel initialization time.
196
199 return;
200 }
202} // __kmp_print_version_2
203
204// end of file //
char const * __kmp_barrier_type_name[bs_last_barrier]
Definition: kmp_global.cpp:108
char const * __kmp_barrier_pattern_name[bp_last_bar]
Definition: kmp_global.cpp:114
kmp_bar_pat_e __kmp_barrier_gather_pattern[bs_last_barrier]
Definition: kmp_global.cpp:92
kmp_uint32 __kmp_barrier_release_branch_bits[bs_last_barrier]
Definition: kmp_global.cpp:91
#define TRUE
Definition: kmp.h:1324
#define FALSE
Definition: kmp.h:1323
int __kmp_env_consistency_check
Definition: kmp_global.cpp:423
kmp_uint32 __kmp_barrier_gather_branch_bits[bs_last_barrier]
Definition: kmp_global.cpp:90
@ bs_plain_barrier
Definition: kmp.h:2132
@ bs_last_barrier
Definition: kmp.h:2138
kmp_bar_pat_e __kmp_barrier_release_pattern[bs_last_barrier]
Definition: kmp_global.cpp:93
#define K_DIAG(d, x)
Definition: kmp_debug.h:163
void __kmp_printf(char const *format,...)
Definition: kmp_io.cpp:186
#define KMP_AFFINITY_SUPPORTED
Definition: kmp_os.h:88
char const __kmp_version_omp_api[]
Definition: kmp_runtime.cpp:66
void __kmp_str_buf_free(kmp_str_buf_t *buffer)
Definition: kmp_str.cpp:123
int __kmp_str_buf_print(kmp_str_buf_t *buffer, char const *format,...)
Definition: kmp_str.cpp:221
#define __kmp_str_buf_init(b)
Definition: kmp_str.h:40
#define i
Definition: kmp_stub.cpp:87
#define KMP_COPYRIGHT
Definition: kmp_version.cpp:92
#define KMP_COMPILER
Definition: kmp_version.cpp:73
int const __kmp_version_build
Definition: kmp_version.cpp:96
#define stringer(x)
Definition: kmp_version.cpp:22
char const __kmp_version_build_time[]
char const __kmp_copyright[]
char const __kmp_version_build_compiler[]
char const __kmp_version_lib_type[]
#define KMP_VERSION_BUILD
Definition: kmp_version.cpp:18
void __kmp_print_version_1(void)
char const __kmp_version_link_type[]
#define KMP_LIBRARY
Definition: kmp_version.cpp:91
static int __kmp_version_1_printed
char const __kmp_version_copyright[]
void __kmp_print_version_2(void)
char const __kmp_version_lib_ver[]
int const __kmp_version_minor
Definition: kmp_version.cpp:95
int const __kmp_version_major
Definition: kmp_version.cpp:94
static int __kmp_version_2_printed
#define KMP_LIB_TYPE
Definition: kmp_version.cpp:80
#define KMP_LINK_TYPE
Definition: kmp_version.cpp:87
int const __kmp_openmp_version
Definition: kmp_version.cpp:97
#define KMP_VERSION_PREFIX
Definition: kmp_version.h:34
char const __kmp_version_alt_comp[]
char const __kmp_version_target_env[]
char const __kmp_version_lock[]
#define KMP_VERSION_MINOR
Definition: kmp_version.h:23
#define KMP_VERSION_MAGIC_LEN
Definition: kmp_version.h:32
#define KMP_VERSION_PREF_STR
Definition: kmp_version.h:33
char * str
Definition: kmp_str.h:33