Ask coding questions

← Back to all posts
Are vectorized instructions supported?
mwilki7 (280)

I wanted to toy around with the vectorized instruction set (128/256/512 bit registers) but I can't seem to get this to compile. It generates this error message:

main.cpp:7:16: error: always_inline function '_mm256_set_epi32' requires target feature
      'avx', but would be inlined into function 'main' that is compiled without support for
    __m256i a =_mm256_set_epi32(5, 5, 5, 5, 5, 5, 5, 5);

Am I missing any includes or is a certain compiler option necessary?

Answered by SPQR (414) [earned 5 cycles]
View Answer
SPQR (414)

There's probably some flags you need to add. Try forking and modifying this repl to get what you need. :)