00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #include "kmp.h"
00048 #include "kmp_io.h"
00049 #include "kmp_version.h"
00050
00051
00052 #define KMP_VERSION_BUILD 00000000
00053
00054
00055 #define _stringer( x ) #x
00056 #define stringer( x ) _stringer( x )
00057
00058
00059 #ifdef __INTEL_COMPILER
00060 #if __INTEL_COMPILER == 1010
00061 #define KMP_COMPILER "Intel C++ Compiler 10.1"
00062 #elif __INTEL_COMPILER == 1100
00063 #define KMP_COMPILER "Intel C++ Compiler 11.0"
00064 #elif __INTEL_COMPILER == 1110
00065 #define KMP_COMPILER "Intel C++ Compiler 11.1"
00066 #elif __INTEL_COMPILER == 1200
00067 #define KMP_COMPILER "Intel C++ Compiler 12.0"
00068 #elif __INTEL_COMPILER == 1210
00069 #define KMP_COMPILER "Intel C++ Compiler 12.1"
00070 #elif __INTEL_COMPILER == 1300
00071 #define KMP_COMPILER "Intel C++ Compiler 13.0"
00072 #elif __INTEL_COMPILER == 1310
00073 #define KMP_COMPILER "Intel C++ Compiler 13.1"
00074 #elif __INTEL_COMPILER == 9999
00075 #define KMP_COMPILER "Intel C++ Compiler mainline"
00076 #endif
00077 #elif defined( __GNUC__ )
00078 #define KMP_COMPILER "GCC " stringer( __GNUC__ ) "." stringer( __GNUC_MINOR__ )
00079 #endif
00080 #ifndef KMP_COMPILER
00081 #warning "Unknown compiler"
00082 #define KMP_COMPILER "unknown compiler"
00083 #endif
00084
00085
00086 #ifdef KMP_STUB
00087 #define KMP_LIB_TYPE "stub"
00088 #else
00089 #define KMP_LIB_TYPE "performance"
00090 #endif // KMP_LIB_TYPE
00091
00092
00093 #ifdef GUIDEDLL_EXPORTS
00094 #define KMP_LINK_TYPE "dynamic"
00095 #else
00096 #define KMP_LINK_TYPE "static"
00097 #endif // KMP_LINK_TYPE
00098
00099
00100 #define KMP_LIBRARY KMP_LIB_TYPE " library (" KMP_LINK_TYPE ")"
00101 #define KMP_COPYRIGHT "Copyright (C) 1997-2013, Intel Corporation. All Rights Reserved."
00102
00103 int const __kmp_version_major = KMP_VERSION_MAJOR;
00104 int const __kmp_version_minor = KMP_VERSION_MINOR;
00105 int const __kmp_version_build = KMP_VERSION_BUILD;
00106 int const __kmp_openmp_version =
00107 #if OMP_30_ENABLED
00108 201107;
00109 #else
00110 200505;
00111 #endif
00112
00113
00114
00115
00116
00117 char const __kmp_copyright[] =
00118 KMP_VERSION_PREFIX KMP_LIBRARY
00119 " ver. " stringer( KMP_VERSION_MAJOR ) "." stringer( KMP_VERSION_MINOR )
00120 "." stringer( KMP_VERSION_BUILD ) " "
00121 KMP_COPYRIGHT;
00122
00123 char const __kmp_version_copyright[] = KMP_VERSION_PREFIX KMP_COPYRIGHT;
00124 char const __kmp_version_lib_ver[] = KMP_VERSION_PREFIX "version: " stringer( KMP_VERSION_MAJOR ) "." stringer( KMP_VERSION_MINOR ) "." stringer( KMP_VERSION_BUILD );
00125 char const __kmp_version_lib_type[] = KMP_VERSION_PREFIX "library type: " KMP_LIB_TYPE;
00126 char const __kmp_version_link_type[] = KMP_VERSION_PREFIX "link type: " KMP_LINK_TYPE;
00127 char const __kmp_version_build_time[] = KMP_VERSION_PREFIX "build time: " _KMP_BUILD_TIME;
00128 #if __MIC__
00129 char const __kmp_version_target_env[] = KMP_VERSION_PREFIX "target environment: MIC_";
00130 #elif __MIC2__
00131 char const __kmp_version_target_env[] = KMP_VERSION_PREFIX "target environment: MIC__";
00132 #endif
00133 char const __kmp_version_build_compiler[] = KMP_VERSION_PREFIX "build compiler: " KMP_COMPILER;
00134
00135
00136
00137
00138 static int __kmp_version_1_printed = FALSE;
00139
00140 void
00141 __kmp_print_version_1( void )
00142 {
00143 if ( __kmp_version_1_printed ) {
00144 return;
00145 };
00146 __kmp_version_1_printed = TRUE;
00147
00148 #ifndef KMP_STUB
00149 kmp_str_buf_t buffer;
00150 __kmp_str_buf_init( & buffer );
00151
00152 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_copyright[ KMP_VERSION_MAGIC_LEN ] );
00153 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_lib_ver[ KMP_VERSION_MAGIC_LEN ] );
00154 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_lib_type[ KMP_VERSION_MAGIC_LEN ] );
00155 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_link_type[ KMP_VERSION_MAGIC_LEN ] );
00156 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_build_time[ KMP_VERSION_MAGIC_LEN ] );
00157 #if KMP_MIC
00158 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_target_env[ KMP_VERSION_MAGIC_LEN ] );
00159 #endif
00160 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_build_compiler[ KMP_VERSION_MAGIC_LEN ] );
00161 #if defined(KMP_GOMP_COMPAT)
00162 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_alt_comp[ KMP_VERSION_MAGIC_LEN ] );
00163 #endif
00164 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_omp_api[ KMP_VERSION_MAGIC_LEN ] );
00165 __kmp_str_buf_print( & buffer, "%sdynamic error checking: %s\n", KMP_VERSION_PREF_STR, ( __kmp_env_consistency_check ? "yes" : "no" ) );
00166 #ifdef KMP_DEBUG
00167 for ( int i = bs_plain_barrier; i < bs_last_barrier; ++ i ) {
00168 __kmp_str_buf_print(
00169 & buffer,
00170 "%s%s barrier branch bits: gather=%u, release=%u\n",
00171 KMP_VERSION_PREF_STR,
00172 __kmp_barrier_type_name[ i ],
00173 __kmp_barrier_gather_branch_bits[ i ],
00174 __kmp_barrier_release_branch_bits[ i ]
00175 );
00176 };
00177 for ( int i = bs_plain_barrier; i < bs_last_barrier; ++ i ) {
00178 __kmp_str_buf_print(
00179 & buffer,
00180 "%s%s barrier pattern: gather=%s, release=%s\n",
00181 KMP_VERSION_PREF_STR,
00182 __kmp_barrier_type_name[ i ],
00183 __kmp_barrier_pattern_name[ __kmp_barrier_gather_pattern[ i ] ],
00184 __kmp_barrier_pattern_name[ __kmp_barrier_release_pattern[ i ] ]
00185 );
00186 };
00187 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_lock[ KMP_VERSION_MAGIC_LEN ] );
00188 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_perf_v19[ KMP_VERSION_MAGIC_LEN ] );
00189 __kmp_str_buf_print( & buffer, "%s\n", & __kmp_version_perf_v106[ KMP_VERSION_MAGIC_LEN ] );
00190 #endif
00191 __kmp_str_buf_print(
00192 & buffer,
00193 "%sthread affinity support: %s\n",
00194 KMP_VERSION_PREF_STR,
00195 #if KMP_OS_WINDOWS || KMP_OS_LINUX
00196 (
00197 KMP_AFFINITY_CAPABLE()
00198 ?
00199 (
00200 __kmp_affinity_type == affinity_none
00201 ?
00202 "not used"
00203 :
00204 "yes"
00205 )
00206 :
00207 "no"
00208 )
00209 #else
00210 "no"
00211 #endif
00212 );
00213 __kmp_printf( "%s", buffer.str );
00214 __kmp_str_buf_free( & buffer );
00215 K_DIAG( 1, ( "KMP_VERSION is true\n" ) );
00216 #endif // KMP_STUB
00217 }
00218
00219
00220
00221
00222 static int __kmp_version_2_printed = FALSE;
00223
00224 void
00225 __kmp_print_version_2( void ) {
00226 if ( __kmp_version_2_printed ) {
00227 return;
00228 };
00229 __kmp_version_2_printed = TRUE;
00230
00231 #ifndef KMP_STUB
00232 #endif // KMP_STUB
00233 }
00234
00235