# TODO remove all references to GMX_CPU_ACCELERATION in master branch
endif()
-if(NOT GMX_TARGET_MIC)
- include(gmxDetectSimd)
- gmx_detect_simd(GMX_SUGGESTED_SIMD)
-else()
- set(GMX_SUGGESTED_SIMD "None")
-endif()
+include(gmxDetectSimd)
+gmx_detect_simd(GMX_SUGGESTED_SIMD)
gmx_option_multichoice(
GMX_SIMD
"SIMD instruction set for CPU kernels and compiler optimization"
"${GMX_SUGGESTED_SIMD}"
- None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 ARM_NEON ARM_NEON_ASIMD IBM_QPX IBM_VMX IBM_VSX Sparc64_HPC_ACE Reference)
+ None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 MIC ARM_NEON ARM_NEON_ASIMD IBM_QPX IBM_VMX IBM_VSX Sparc64_HPC_ACE Reference)
gmx_option_multichoice(
GMX_FFT_LIBRARY
# HPC-ACE is always present. In the future we
# should add detection for HPC-ACE2 here.
set(${_suggested_simd} "Sparc64_HPC_ACE")
+ elseif(GMX_TARGET_MIC)
+ set(${_suggested_simd} "MIC")
elseif(GMX_TARGET_X86)
gmx_suggest_x86_simd(${_suggested_simd})
else()
set(GMX_SIMD_X86_AVX2_256 1)
set(SIMD_STATUS_MESSAGE "Enabling 256-bit AVX2 SIMD instructions")
+elseif(${GMX_SIMD} STREQUAL "MIC")
+
+ # No flags needed. Not testing.
+ set(GMX_SIMD_X86_MIC 1)
+ set(SIMD_STATUS_MESSAGE "Enabling MIC (Xeon Phi) SIMD instructions")
+
elseif(${GMX_SIMD} STREQUAL "ARM_NEON")
gmx_find_cflag_for_source(CFLAGS_ARM_NEON "C compiler 32-bit ARM NEON flag"
/* AVX2 256-bit SIMD instruction set level was selected */
#cmakedefine GMX_SIMD_X86_AVX2_256
+/* MIC (Xeon Phi) SIMD instruction set level was selected */
+#cmakedefine GMX_SIMD_X86_MIC
+
/* 32-bit ARM NEON SIMD instruction set level was selected */
#cmakedefine GMX_SIMD_ARM_NEON
#define gmx_stringify2(x) #x
#define gmx_stringify(x) gmx_stringify2(x)
fprintf(fp, "invsqrt routine: %s\n", gmx_stringify(gmx_invsqrt(x)));
-#ifndef __MIC__
fprintf(fp, "SIMD instructions: %s\n", GMX_SIMD_STRING);
-#else
- fprintf(fp, "SIMD instructions: %s\n", "Intel MIC");
-#endif
-
fprintf(fp, "FFT library: %s\n", gmx_fft_get_version_info());
#ifdef HAVE_RDTSCP
fprintf(fp, "RDTSCP usage: enabled\n");
#else /* GMX_SIMD_REFERENCE */
-#if defined GMX_TARGET_X86 && !defined __MIC__
+#if defined GMX_TARGET_X86 && !defined GMX_SIMD_X86_MIC
/* Include x86 SSE2 compatible SIMD functions */
/* Set the stride for the lookup of the two LJ parameters from their
#endif
#endif /* GMX_DOUBLE */
-#else /* GMX_TARGET_X86 && !__MIC__ */
+#else /* GMX_TARGET_X86 && !GMX_SIMD_X86_MIC */
#if GMX_SIMD_REAL_WIDTH > 4
/* For width>4 we use unaligned loads. And thus we can use the minimal stride */
#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_ibm_qpx.h"
#endif /* GMX_SIMD_IBM_QPX */
-#ifdef __MIC__
+#ifdef GMX_SIMD_X86_MIC
#include "gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_mic.h"
#endif
-#endif /* GMX_TARGET_X86 && !__MIC__ */
+#endif /* GMX_TARGET_X86 && !GMX_SIMD_X86_MIC */
#endif /* GMX_SIMD_REFERENCE */
/* MIC for double is implemented in the SIMD module but so far missing in
mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_mic.h */
-#if defined __MIC__ && !defined GMX_DOUBLE
+#if defined GMX_SIMD_X86_MIC && !defined GMX_DOUBLE
#define GMX_NBNXN_SIMD
#endif
* this SIMD module are static, so it will work perfectly fine to include this
* file with different SIMD definitions for different files.
*/
-#if defined __MIC__
+#if defined GMX_SIMD_X86_MIC
# include "impl_intel_mic/impl_intel_mic.h"
#elif defined GMX_SIMD_X86_AVX2_256
# include "impl_x86_avx2_256/impl_x86_avx2_256.h"