Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failure to inline avx intrinsic #1

Closed
ekg opened this issue May 28, 2019 · 3 comments
Closed

failure to inline avx intrinsic #1

ekg opened this issue May 28, 2019 · 3 comments

Comments

@ekg
Copy link

ekg commented May 28, 2019

I'm compiling on a system that has AVX, with gcc version 7.4.0-1ubuntu1~18.04.

I ran into this error:

[ 29%] Building CXX object CMakeFiles/PaSGAL.dir/src/main.cpp.o
In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:45:0,
                 from /home/erik/PaSGAL/src/include/base_types.hpp:10,
                 from /home/erik/PaSGAL/src/include/parseCmdArgs.hpp:10,
                 from /home/erik/PaSGAL/src/main.cpp:12:
/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h: In static member function ‘static __mxxxi psgl::SimdInst<int>::add(const __mxxxi&, const __mxxxi&)’:
/usr/lib/gcc/x86_64-linux-gnu/7/include/avx512fintrin.h:818:1: error: inlining failed in call to always_inline ‘__m512i _mm512_add_epi32(__m512i, __m512i)’: target specific option mismatch
 _mm512_add_epi32 (__m512i __A, __m512i __B)
 ^~~~~~~~~~~~~~~~
In file included from /home/erik/PaSGAL/src/include/align.hpp:20:0,
                 from /home/erik/PaSGAL/src/main.cpp:14:
/home/erik/PaSGAL/src/include/align_vectorized.hpp:48:95: note: called from here
       static inline __mxxxi add (const __mxxxi& a, const __mxxxi& b) { return _mm512_add_epi32(a, b); }
                                                                               ~~~~~~~~~~~~~~~~^~~~~~
CMakeFiles/PaSGAL.dir/build.make:62: recipe for target 'CMakeFiles/PaSGAL.dir/src/main.cpp.o' failed

Any suggestions about how to resolve it?

@cjain7
Copy link
Member

cjain7 commented May 29, 2019

Check if the CPU you are using supports AVX512 or AVX2 or none... you'll need to compile accordingly (see the cmake option -DSIMD_SUPPORT in README).

Assuming you are using linux, flags in /proc/cpuinfo will tell you the available SIMD support.

@ekg
Copy link
Author

ekg commented May 29, 2019

It looks like I have only avx and avx2:

-> % lscpu | grep Flags | tr ' ' '\n' | grep avx 
avx
avx2

I'll try to set the flags accordingly.

@ekg
Copy link
Author

ekg commented May 29, 2019

Building with cmake -H. -Bbuild -DSIMD_SUPPORT=avx2 && cmake --build build -- -j 4 solves my problem!

@ekg ekg closed this as completed May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants