I’m using AVX2 instruction to initialize static inline variables in my code. But the following does not compile.
#pragma GCC target("avx2")
class A {
static inline __m256i mask = _mm256_set1_epi32(0xffffffff);
...
};
...
How do I make it compile?
The compiler says “AVX vector return without AVX enabled changes the ABI” although I’m using #pragma
to enable AVX2. I also found that using -mavx2
as compile options successfully compiles the code.
I’m implementing montgomery reduction with simd intrinsics. I’ll use this to solve various problems in competitive programming sites. But I can’t change the compiler options in online judges. I have to rely only on source code. So, is there any way to compile the program without using the compiler argument -mavx2
.
Soumyadeep Dash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.