Commit 5a1efab3 authored by Andreas Marek's avatar Andreas Marek

Better control of AVX kernels

Sometimes it might be desirable that only one of the specifc AVX
kernels (AVX, AVX2, AVX512) are build, even though the processor
supports all (or several) of these instructions.

The flag --disable-[avx | avx2 | avx512] allows to define which kernels
should NOT be build. The default is: what can be build will be build
parent 554d2785
......@@ -284,22 +284,33 @@ else
install_complex_sse_block2=no
fi
dnl check whether one can compile with avx - gcc intrinsics
dnl first pass: try with specified CFLAGS and CXXFLAGS
AC_MSG_CHECKING([whether we can compile AVX gcc intrinsics in C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h>
int main(int argc, char **argv){
double* q;
__m256d a1_1 = _mm256_load_pd(q);
return 0;
}
])],
[can_compile_avx=yes],
[can_compile_avx=no]
)
AC_MSG_RESULT([${can_compile_avx}])
AC_MSG_CHECKING(whether --enable-avx is specified)
AC_ARG_ENABLE([avx],
AS_HELP_STRING([--enable-avx],
[check whether AVX kernels can be build, default yes]),
[check_avx=no],
[check_avx=yes])
AC_MSG_RESULT([$check_avx])
if test "${check_avx}" = "yes"; then
dnl check whether one can compile with avx - gcc intrinsics
dnl first pass: try with specified CFLAGS and CXXFLAGS
AC_MSG_CHECKING([whether we can compile AVX gcc intrinsics in C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h>
int main(int argc, char **argv){
double* q;
__m256d a1_1 = _mm256_load_pd(q);
return 0;
}
])],
[can_compile_avx=yes],
[can_compile_avx=no]
)
AC_MSG_RESULT([${can_compile_avx}])
else
can_compile_avx=no
fi
#if test "${can_compile_avx}" = "yes" ; then
# AC_MSG_CHECKING([whether we can compile AVX gcc intrinsics in C++])
......@@ -322,20 +333,33 @@ AC_MSG_RESULT([${can_compile_avx}])
# fi
#fi
AC_MSG_CHECKING([whether we can compile AVX2 gcc intrinsics in C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h>
int main(int argc, char **argv){
double* q;
__m256d q1 = _mm256_load_pd(q);
__m256d y1 = _mm256_fmadd_pd(q1, q1, q1);
return 0;
}
])],
[can_compile_avx2=yes],
[can_compile_avx2=no]
)
AC_MSG_RESULT([${can_compile_avx2}])
AC_MSG_CHECKING(whether --enable-avx2 is specified)
AC_ARG_ENABLE([avx2],
AS_HELP_STRING([--enable-avx2],
[check whether AVX2 kernels can be build, default yes]),
[check_avx2=no],
[check_avx2=yes])
AC_MSG_RESULT([$check_avx2])
if test "${check_avx2}" = "yes"; then
AC_MSG_CHECKING([whether we can compile AVX2 gcc intrinsics in C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h>
int main(int argc, char **argv){
double* q;
__m256d q1 = _mm256_load_pd(q);
__m256d y1 = _mm256_fmadd_pd(q1, q1, q1);
return 0;
}
])],
[can_compile_avx2=yes],
[can_compile_avx2=no]
)
AC_MSG_RESULT([${can_compile_avx2}])
else
can_compile_avx2=no
fi
#if test "${can_compile_avx2}" = "yes" ; then
# AC_MSG_CHECKING([whether we can compile AVX2 gcc intrinsics in C++])
# AC_LANG_PUSH([C++])
......@@ -358,20 +382,32 @@ AC_MSG_RESULT([${can_compile_avx2}])
# fi
#fi
AC_MSG_CHECKING([whether we can compile AVX512 gcc intrinsics in C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h>
int main(int argc, char **argv){
double* q;
__m512d q1 = _mm512_load_pd(q);
__m512d y1 = _mm512_fmadd_pd(q1, q1, q1);
return 0;
}
])],
[can_compile_avx512=yes],
[can_compile_avx512=no]
)
AC_MSG_RESULT([${can_compile_avx512}])
AC_MSG_CHECKING(whether --enable-avx512 is specified)
AC_ARG_ENABLE([avx512],
AS_HELP_STRING([--enable-avx512],
[check whether AVX512 kernels can be build, default yes]),
[check_avx512=no],
[check_avx512=yes])
AC_MSG_RESULT([$check_avx512])
if test "${check_avx512}" = "yes"; then
AC_MSG_CHECKING([whether we can compile AVX512 gcc intrinsics in C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#include <x86intrin.h>
int main(int argc, char **argv){
double* q;
__m512d q1 = _mm512_load_pd(q);
__m512d y1 = _mm512_fmadd_pd(q1, q1, q1);
return 0;
}
])],
[can_compile_avx512=yes],
[can_compile_avx512=no]
)
AC_MSG_RESULT([${can_compile_avx512}])
else
can_compile_avx512=no
fi
#if test "${can_compile_avx512}" = "yes" ; then
# AC_MSG_CHECKING([whether we can compile AVX512 gcc intrinsics in C++])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment