Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Related to #667, I found that with pocl-1.4, there is again CPU detection happening on the build machine.
The build environment has several significant diffs:
+++ pocl-1.4/build/sleef_config_temp_avx.h 2019-11-19 10:17:59.409588738 +000 0 @@ -3,4 +3,3 @@ #define SLEEF_DOUBLE_VEC_AVAILABLE #define SLEEF_VINT_IS_VLONG #define SLEEF_VEC_128_AVAILABLE -#define SLEEF_VEC_256_AVAILABLE +++ pocl-1.4/build/sleef_config_temp_avx_fma4.h 2019-11-19 10:21:44.401592562 +0000 @@ -3,8 +3,3 @@ #define SLEEF_DOUBLE_VEC_AVAILABLE #define SLEEF_VINT_IS_VLONG #define SLEEF_VEC_128_AVAILABLE -#define HAVE_FMA32_128 -#define HAVE_FMA64_128 -#define SLEEF_VEC_256_AVAILABLE -#define HAVE_FMA32_256 -#define HAVE_FMA64_256
Our build call is around line 100 of https://build.opensuse.org/package/view_file/openSUSE:Factory/pocl/pocl.spec
This bug was found as part of my work on reproducible builds for openSUSE.
I could not reproduce, but the those lines removed in the diff should definitely be there.
The checks for CPU features are done in
on the source file
If by "CPU detection happening" you mean CMake generating of sleef_config_* headers, that has been there since pocl 1.0 or so, and it's independent of the host CPU when building with
If you're building a distro build, then yes, wherever you build. As you can see the clang arguments:
which means Clang should always compile for (and report features for) Intel Haswell. Unlike
A pocl "distro" build precompiles several kernel libraries for different hardcoded CPU names with
It seems your Clang reports incorrect CPU extensions for some reason. Possibly a bug in Clang or something else, but doesn't seems to be a bug in pocl (so far).
For "avx" kernel library, we use
Try this command in your build environment:
If it prints an error, your Clang (or build environment) is broken.