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.
2
Answers
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.
__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
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”.