File tree Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,13 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
38
38
39
39
OPAL_VAR_SCOPE_PUSH([op_avx_cflags_save])
40
40
41
- AS_IF([test " $opal_cv_asm_arch " = " X86_64" ],
41
+ case " ${host} " in
42
+ x86_64-* x32|i? 86-* |x86_64* |amd64* )
43
+ check_avx=" yes" ;;
44
+ * )
45
+ check_avx=" no" ;;
46
+ esac
47
+ AS_IF([test " $check_avx " = " yes" ],
42
48
[AC_LANG_PUSH([C])
43
49
44
50
#
@@ -123,6 +129,28 @@ AC_DEFUN([MCA_ompi_op_avx_CONFIG],[
123
129
MCA_BUILD_OP_AVX512_FLAGS= " "
124
130
AC_MSG_RESULT([no])])
125
131
CFLAGS= " $op_avx_cflags_save "
132
+ ])
133
+ #
134
+ # Check for combination of AVX512F + AVX512VL
135
+ #
136
+ AS_IF([test $op_avx512_support -eq 1],
137
+ [AC_MSG_CHECKING([if _mm_max_epi64 generates code that can be compiled])
138
+ op_avx_cflags_save= " $CFLAGS "
139
+ CFLAGS= " $CFLAGS_WITHOUT_OPTFLAGS -O0 $MCA_BUILD_OP_AVX512_FLAGS "
140
+ AC_LINK_IFELSE(
141
+ [AC_LANG_PROGRAM([[# include <immintrin.h>]],
142
+ [[
143
+ # if !defined(__AVX512F__) || !defined(__AVX512VL__) || !defined(__AVX512BW__)
144
+ # error "icc needs the -m flags to provide the AVX* detection macros"
145
+ # endif
146
+ __m128i vA, vB;
147
+ _mm_max_epi64(vA, vB)
148
+ ]])],
149
+ [AC_MSG_RESULT([yes])],
150
+ [op_avx512_support= 0
151
+ MCA_BUILD_OP_AVX512_FLAGS= " "
152
+ AC_MSG_RESULT([no])])
153
+ CFLAGS= " $op_avx_cflags_save "
126
154
])])
127
155
#
128
156
# Check support for AVX2
Original file line number Diff line number Diff line change 32
32
* to a lesser support (AVX512 -> AVX2, AVX2 -> AVX, AVX -> error out).
33
33
*/
34
34
#if defined(GENERATE_AVX512_CODE )
35
+ # define PREPEND _avx512
35
36
# if defined(__AVX512BW__ ) && defined(__AVX512F__ ) && defined(__AVX512VL__ )
36
- # define PREPEND _avx512
37
+ /* all good */
37
38
# else
38
39
# undef GENERATE_AVX512_CODE
39
40
# endif /* defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512VL__) */
40
41
#endif /* defined(GENERATE_AVX512_CODE) */
41
42
42
43
#if !defined(PREPEND ) && defined(GENERATE_AVX2_CODE )
44
+ # define PREPEND _avx2
43
45
# if defined(__AVX2__ )
44
- # define PREPEND _avx2
46
+ /* all good */
45
47
# else
46
48
# undef GENERATE_AVX2_CODE
47
49
# endif /* defined(__AVX2__) */
You can’t perform that action at this time.
0 commit comments