Example codes of the book "CUDA By Example" have problems when compiling

I’m now studying CUDA with the book “CUDA By Example”. My environment is VS2015 and my system is Win10. CUDA version is the latest.

Any example codes that include “cpu_anim.h” will report thousands of errors like “Variable ‘EMIT’ is not a type name”, "undefined symbol ‘_m64’ "and so on. The first error occurs in multiple head files such as cmath, emmintrin.h, exception, immintrin.h, iosfwd.

However, those codes can still be successfully built and executed with the correct result.

How can I solve this? Is that a matter of the compiling environment or the header file “cpu_anim.h”?

By the way, did the author provide any update of those example codes to fit latest CUDA and VS?

No. The codes are 7 years old and haven’t really been maintained, and there are definitely issues when trying to build in current environments.

You mention that "those codes can still be successfully built and executed with the correct result. " So:

  1. It sounds like you are referring to intellisense issues. If that’s the case, there are plenty of descriptions of what to do with intellisense and CUDA - you might try searching on that.

  2. I guess I would also ask: So what’s the problem? You can build the codes and get the correct result – it’s just an intellisense issue (I think?)

Yes, it is an intellisense issue. I just want to get rid of those unnecessary error reports because I can hardly find the error that really matters in the error list.

Do you think it will be better if I use VS2010 instead?

intellisense never known how to handle cuda language. it tries to parse .cu files as plain C++, which of course fails on nvidia extensions

In VS 2015, there is an error output window that has a selection box where you can choose “Build” or “Build+Intellisense”. If you choose “Build”, the Intellisense “unnecessary error reports” will disappear from that pane.