Reputation: 113
I am using OneAPI with Visual Studio 2019.
I have included immintrin.h.
When building with Intel Oneapp I got the error below. I have checked project settings in case AVX2 isn't enabled, but there is no option to have something similar to arch: AVX2 like used in other compilers.
error : unknown type name '__m256'
Upvotes: 2
Views: 686
Reputation: 11
First, check whether you have support for avx using lscpu. If you cannot find avx flag in the lscpu output your processor might not support avx instructions. To enable avx instructions you need to give -xavx flag for running on Intel processors. example : icpc -xavx <Foo.cpp>
Refer to these websites for better understanding : https://techdecoded.intel.io/resources/vectorization-opportunities-for-improved-performance-with-intel-avx-512/#gs.ybxmlq
https://colfaxresearch.com/knl-avx512/
https://www.alcf.anl.gov/files/Intel%20Compiler%20Optimization%20and%20Building%20for%20KNL.pdf
Regards
Upvotes: 1