|
207 | 207 |
|
208 | 208 | # check if compiler supports avx, avx512f |
209 | 209 | # also check if the building machine can run them if not force enabled |
210 | | -AC_CACHE_CHECK([whether -mavx2 is supported], pac_cv_found_avx, |
211 | | - [PAC_C_CHECK_COMPILER_OPTION([-mavx2],pac_cv_found_avx=yes,pac_cv_found_avx=no)], |
212 | | - pac_cv_found_avx=no,pac_cv_found_avx=yes) |
213 | | -AC_CACHE_CHECK([whether -mavx512f is supported], pac_cv_found_avx512f, |
214 | | - [PAC_C_CHECK_COMPILER_OPTION([-mavx512f],pac_cv_found_avx512f=yes,pac_cv_found_avx512f=no)], |
215 | | - pac_cv_found_avx512f=no,pac_cv_found_avx512f=yes) |
| 210 | +AC_CACHE_CHECK([whether -mavx2 is supported], pac_cv_found_avx, [ |
| 211 | + PAC_PUSH_FLAG([CFLAGS]) |
| 212 | + PAC_APPEND_FLAG([-mavx2], [CFLAGS]) |
| 213 | + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <immintrin.h>]],[[ |
| 214 | + const void *src; |
| 215 | + void *dest; |
| 216 | + __m256i ymm = _mm256_loadu_si256(src); |
| 217 | + _mm256_stream_si256(dest, ymm); |
| 218 | + ]])], |
| 219 | + pac_cv_found_avx=yes,pac_cv_found_avx=no) |
| 220 | + PAC_POP_FLAG([CFLAGS])]) |
| 221 | +AC_CACHE_CHECK([whether -mavx512f is supported], pac_cv_found_avx512f, [ |
| 222 | + PAC_PUSH_FLAG([CFLAGS]) |
| 223 | + PAC_APPEND_FLAG([-mavx512f], [CFLAGS]) |
| 224 | + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <immintrin.h>]],[[ |
| 225 | + const void *src; |
| 226 | + void *dest; |
| 227 | + __m512i zmm = _mm512_loadu_si512(src); |
| 228 | + _mm512_stream_si512(dest, zmm); |
| 229 | + ]])], |
| 230 | + pac_cv_found_avx512f=yes,pac_cv_found_avx512f=no) |
| 231 | + PAC_POP_FLAG([CFLAGS])]) |
216 | 232 |
|
217 | 233 | AM_CONDITIONAL([MPL_BUILD_AVX], [test "x$pac_cv_found_avx" = "xyes"]) |
218 | 234 | if test "x$pac_cv_found_avx" = "xyes"; then |
|
0 commit comments