2

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'
Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Noob
  • 103
  • 9
  • I don't know much of anything about OneAPI, but are you sure it's supposed to support SSE/AVX intrinsics? That intrinsics API isn't portable to GPU acceleration or non-x86 platforms. (I'd guess it is supposed to support x86 intrinsics, but *also* some new more portable API. Does `__m128` work? SSE2 is baseline for x86-64 so shouldn't need to be enabled.) – Peter Cordes Mar 19 '21 at 22:32

1 Answers1

1

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