Skip to content

Commit a2041be

Browse files
committed
Always specify the target architecture for AVX
icc does not define the __AVX*__ macros if the corresponding -m architecture flag was not provided. Thus, make sure we always provide it for icc (not not necessarily for gcc). Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
1 parent 8c89e3c commit a2041be

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

ompi/mca/op/avx/configure.m4

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
5050
AC_LINK_IFELSE(
5151
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
5252
[[
53+
#if defined(__ICC) && !defined(__AVX512F__)
54+
#error "icc needs the -m flags to provide the AVX* detection macros
55+
#endif
5356
__m512 vA, vB;
5457
_mm512_add_ps(vA, vB)
5558
]])],
@@ -64,6 +67,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
6467
AC_LINK_IFELSE(
6568
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
6669
[[
70+
#if defined(__ICC) && !defined(__AVX512F__)
71+
#error "icc needs the -m flags to provide the AVX* detection macros
72+
#endif
6773
__m512 vA, vB;
6874
_mm512_add_ps(vA, vB)
6975
]])],
@@ -84,6 +90,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
8490
AC_LINK_IFELSE(
8591
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
8692
[[
93+
#if defined(__ICC) && !defined(__AVX512F__)
94+
#error "icc needs the -m flags to provide the AVX* detection macros
95+
#endif
8796
int A[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
8897
__m512i vA = _mm512_loadu_si512((__m512i*)&(A[1]))
8998
]])],
@@ -103,6 +112,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
103112
AC_LINK_IFELSE(
104113
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
105114
[[
115+
#if defined(__ICC) && !defined(__AVX512F__)
116+
#error "icc needs the -m flags to provide the AVX* detection macros
117+
#endif
106118
__m512i vA, vB;
107119
_mm512_mullo_epi64(vA, vB)
108120
]])],
@@ -121,6 +133,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
121133
AC_LINK_IFELSE(
122134
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
123135
[[
136+
#if defined(__ICC) && !defined(__AVX2__)
137+
#error "icc needs the -m flags to provide the AVX* detection macros
138+
#endif
124139
__m256i vA, vB, vC;
125140
vC = _mm256_and_si256(vA, vB)
126141
]])],
@@ -134,6 +149,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
134149
AC_LINK_IFELSE(
135150
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
136151
[[
152+
#if defined(__ICC) && !defined(__AVX2__)
153+
#error "icc needs the -m flags to provide the AVX* detection macros
154+
#endif
137155
__m256i vA, vB, vC;
138156
vC = _mm256_and_si256(vA, vB)
139157
]])],
@@ -154,6 +172,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
154172
AC_LINK_IFELSE(
155173
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
156174
[[
175+
#if defined(__ICC) && !defined(__AVX2__)
176+
#error "icc needs the -m flags to provide the AVX* detection macros
177+
#endif
157178
int A[8] = {0, 1, 2, 3, 4, 5, 6, 7};
158179
__m256i vA = _mm256_loadu_si256((__m256i*)&A)
159180
]])],
@@ -177,6 +198,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
177198
AC_LINK_IFELSE(
178199
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
179200
[[
201+
#if defined(__ICC) && !defined(__AVX__)
202+
#error "icc needs the -m flags to provide the AVX* detection macros
203+
#endif
180204
__m256 vA, vB, vC;
181205
vC = _mm256_add_ps(vA, vB)
182206
]])],
@@ -192,6 +216,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
192216
AC_LINK_IFELSE(
193217
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
194218
[[
219+
#if defined(__ICC) && !defined(__SSE4_1__)
220+
#error "icc needs the -m flags to provide the AVX* detection macros
221+
#endif
195222
__m128i vA, vB;
196223
(void)_mm_max_epi8(vA, vB)
197224
]])],
@@ -208,6 +235,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
208235
AC_LINK_IFELSE(
209236
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
210237
[[
238+
#if defined(__ICC) && !defined(__SSE3__)
239+
#error "icc needs the -m flags to provide the AVX* detection macros
240+
#endif
211241
int A[4] = {0, 1, 2, 3};
212242
__m128i vA = _mm_lddqu_si128((__m128i*)&A)
213243
]])],
@@ -225,6 +255,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
225255
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
226256
[[
227257
__m256 vA, vB, vC;
258+
#if defined(__ICC) && !defined(__AVX__)
259+
#error "icc needs the -m flags to provide the AVX* detection macros
260+
#endif
228261
vC = _mm256_add_ps(vA, vB)
229262
]])],
230263
[op_avx_support=1
@@ -239,6 +272,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
239272
AC_LINK_IFELSE(
240273
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
241274
[[
275+
#if defined(__ICC) && !defined(__SSE4_1__)
276+
#error "icc needs the -m flags to provide the AVX* detection macros
277+
#endif
242278
__m128i vA, vB;
243279
(void)_mm_max_epi8(vA, vB)
244280
]])],
@@ -250,6 +286,9 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
250286
AC_LINK_IFELSE(
251287
[AC_LANG_PROGRAM([[#include <immintrin.h>]],
252288
[[
289+
#if defined(__ICC) && !defined(__SSE3__)
290+
#error "icc needs the -m flags to provide the AVX* detection macros
291+
#endif
253292
int A[4] = {0, 1, 2, 3};
254293
__m128i vA = _mm_lddqu_si128((__m128i*)&A)
255294
]])],

0 commit comments

Comments
 (0)