[Openmp-commits] [openmp] r305307 - Replace platform macro with KMP_MIC_SUPPORTED
Jonathan Peyton via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jun 13 10:17:27 PDT 2017
Author: jlpeyton
Date: Tue Jun 13 12:17:26 2017
New Revision: 305307
URL: http://llvm.org/viewvc/llvm-project?rev=305307&view=rev
Log:
Replace platform macro with KMP_MIC_SUPPORTED
Differential Revision: https://reviews.llvm.org/D34119
Modified:
openmp/trunk/runtime/src/kmp.h
openmp/trunk/runtime/src/kmp_global.cpp
openmp/trunk/runtime/src/kmp_platform.h
openmp/trunk/runtime/src/kmp_runtime.cpp
openmp/trunk/runtime/src/kmp_settings.cpp
Modified: openmp/trunk/runtime/src/kmp.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp.h?rev=305307&r1=305306&r2=305307&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp.h (original)
+++ openmp/trunk/runtime/src/kmp.h Tue Jun 13 12:17:26 2017
@@ -453,7 +453,7 @@ enum clock_function_type {
};
#endif /* KMP_OS_LINUX */
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
enum mic_type { non_mic, mic1, mic2, mic3, dummy };
#endif
@@ -2940,7 +2940,7 @@ extern enum clock_function_type __kmp_cl
extern int __kmp_clock_function_param;
#endif /* KMP_OS_LINUX */
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
extern enum mic_type __kmp_mic_type;
#endif
Modified: openmp/trunk/runtime/src/kmp_global.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_global.cpp?rev=305307&r1=305306&r2=305307&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_global.cpp (original)
+++ openmp/trunk/runtime/src/kmp_global.cpp Tue Jun 13 12:17:26 2017
@@ -238,7 +238,7 @@ enum clock_function_type __kmp_clock_fun
int __kmp_clock_function_param;
#endif /* KMP_OS_LINUX */
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
enum mic_type __kmp_mic_type = non_mic;
#endif
Modified: openmp/trunk/runtime/src/kmp_platform.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_platform.h?rev=305307&r1=305306&r2=305307&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_platform.h (original)
+++ openmp/trunk/runtime/src/kmp_platform.h Tue Jun 13 12:17:26 2017
@@ -176,6 +176,10 @@
/* Specify 32 bit architectures here */
#define KMP_32_BIT_ARCH (KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_MIPS)
+// Platforms which support Intel(R) Many Integrated Core Architecture
+#define KMP_MIC_SUPPORTED \
+ ((KMP_ARCH_X86 || KMP_ARCH_X86_64) && (KMP_OS_LINUX || KMP_OS_WINDOWS))
+
// TODO: Fixme - This is clever, but really fugly
#if (1 != \
KMP_ARCH_X86 + KMP_ARCH_X86_64 + KMP_ARCH_ARM + KMP_ARCH_PPC64 + \
Modified: openmp/trunk/runtime/src/kmp_runtime.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.cpp?rev=305307&r1=305306&r2=305307&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.cpp (original)
+++ openmp/trunk/runtime/src/kmp_runtime.cpp Tue Jun 13 12:17:26 2017
@@ -6268,7 +6268,7 @@ void __kmp_unregister_library(void) {
// End of Library registration stuff.
// -----------------------------------------------------------------------------
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
static void __kmp_check_mic_type() {
kmp_cpuid_t cpuid_state = {0};
@@ -6284,7 +6284,7 @@ static void __kmp_check_mic_type() {
}
}
-#endif /* KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS) */
+#endif /* KMP_MIC_SUPPORTED */
static void __kmp_do_serial_initialize(void) {
int i, gtid;
@@ -6356,7 +6356,7 @@ static void __kmp_do_serial_initialize(v
__kmp_runtime_initialize();
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
__kmp_check_mic_type();
#endif
@@ -6423,7 +6423,7 @@ static void __kmp_do_serial_initialize(v
#undef kmp_reduction_barrier_release_bb
#undef kmp_reduction_barrier_gather_bb
#endif // KMP_FAST_REDUCTION_BARRIER
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
if (__kmp_mic_type == mic2) { // KNC
// AC: plane=3,2, forkjoin=2,1 are optimal for 240 threads on KNC
__kmp_barrier_gather_branch_bits[bs_plain_barrier] = 3; // plain gather
@@ -6437,8 +6437,8 @@ static void __kmp_do_serial_initialize(v
__kmp_barrier_gather_pattern[bs_reduction_barrier] = bp_hierarchical_bar;
__kmp_barrier_release_pattern[bs_reduction_barrier] = bp_hierarchical_bar;
}
-#endif
-#endif
+#endif // KMP_FAST_REDUCTION_BARRIER
+#endif // KMP_MIC_SUPPORTED
// From KMP_CHECKS initialization
#ifdef KMP_DEBUG
@@ -7513,7 +7513,7 @@ __kmp_determine_reduction_method(
int teamsize_cutoff = 4;
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
if (__kmp_mic_type != non_mic) {
teamsize_cutoff = 8;
}
Modified: openmp/trunk/runtime/src/kmp_settings.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_settings.cpp?rev=305307&r1=305306&r2=305307&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_settings.cpp (original)
+++ openmp/trunk/runtime/src/kmp_settings.cpp Tue Jun 13 12:17:26 2017
@@ -2173,7 +2173,7 @@ static void __kmp_parse_affinity_env(cha
}; // if
if (__kmp_affinity_gran == affinity_gran_default) {
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
if (__kmp_mic_type != non_mic) {
if (__kmp_affinity_verbose || __kmp_affinity_warnings) {
KMP_WARNING(AffGranUsing, "KMP_AFFINITY", "fine");
@@ -2819,7 +2819,7 @@ static void __kmp_stg_parse_proc_bind(ch
// OMP_PROC_BIND => granularity=fine,scatter on MIC
// OMP_PROC_BIND => granularity=core,scatter elsewhere
__kmp_affinity_type = affinity_scatter;
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
if (__kmp_mic_type != non_mic)
__kmp_affinity_gran = affinity_gran_fine;
else
@@ -5207,7 +5207,7 @@ void __kmp_env_initialize(char const *st
#endif /* OMP_40_ENABLED */
if (__kmp_affinity_type == affinity_default) {
#if OMP_40_ENABLED
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
if (__kmp_mic_type != non_mic) {
__kmp_nested_proc_bind.bind_types[0] = proc_bind_intel;
} else
@@ -5216,7 +5216,7 @@ void __kmp_env_initialize(char const *st
__kmp_nested_proc_bind.bind_types[0] = proc_bind_false;
}
#endif /* OMP_40_ENABLED */
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
if (__kmp_mic_type != non_mic) {
__kmp_affinity_type = affinity_scatter;
} else
@@ -5227,7 +5227,7 @@ void __kmp_env_initialize(char const *st
}
if ((__kmp_affinity_gran == affinity_gran_default) &&
(__kmp_affinity_gran_levels < 0)) {
-#if KMP_ARCH_X86_64 && (KMP_OS_LINUX || KMP_OS_WINDOWS)
+#if KMP_MIC_SUPPORTED
if (__kmp_mic_type != non_mic) {
__kmp_affinity_gran = affinity_gran_fine;
} else
More information about the Openmp-commits
mailing list