skip to Main Content

I want to use some avx2 functions by including <immintrin.h> library in my project; however, Vscode does not seem to recognize these functions, as it is showing that my project contains various identifier "__m256i" is undefined errors as the attached pictures. I can compile and run smoothly, but the errors are really disturbing. I tried adding the declarations of these types into the Vscode path, but it does not help.

I am using the latest Vscode version in Centos 7.7.

Vscode show errors

Try added the include path, but does not help

2

Answers


  1. Chosen as BEST ANSWER

    I solved the problem myself by restarting my computer. I think somehow at that time the computer did not recognize the definition of Intel AVX functions.


  2. __mm256i is a typo for __m256i.

    The type names have 2 underscores and one m like __m128i
    The intrinsic function names have one underscore and 2 ems like like _mm_add_epi32

    I can compile and run smoothly, but the errors are really disturbing.

    That’s highly implausible, are you sure you’re not running an old version of your executable from before you introduced this bug in your source? This is an error, not a warning; gcc won’t produce a .o from a source file with this bug. Hard errors are the opposite of compiling “smoothly”.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search