niedziela, 1 maja 2016

GCC: and inlining failed in call to always_inline 'FOO': target specific option mismatch

AVX512 comes with the number of variants, and a compiler must know which AVX512 version it compiles.

GCC error inlining failed in call to always_inline 'FOO': target specific option mismatch occurs when a program containing some SIMD-intrinsics, and compiler has wrong or missing target options. The target option are introduced by "-m".

Lets look at the error from real world:

/usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlbwintrin.h:790:1: error: inlining failed in call to always_inline ‘_mm_movm_epi8’: target specific option mismatch


Now, when open avx512vlbwintrin.h, we see at the beginning of file:

...
#pragma GCC push_options
#pragma GCC target("avx512vl,avx512bw")
#define __DISABLE_AVX512VLBW__
...

Thus, in order to properly compile the program, gcc have to be feed with the two options listed at the target line: -mavx512vl and -mavx512bw.