__syncthreads, atomicInc, __popc and others undefined...

Hi all, I am new to cuda, and am trying to port some existing code from linux to windows (visual studio 2015, cuda 8).

In the original project properties, Preprocessor definitions include:


However, when I add this to my visual studio project, I get:

warp_shuffle.hpp(144): error : identifier "__hiloint2double" is undefined
 identifier "__popc" is undefined
 identifier "__syncthreads" is undefined
identifier "atomicInc" is undefined
identifier "atomicInc" is undefined
 error : identifier "__float2int_rn" is undefined
cuda\detail\../warp_shuffle.hpp(90): error : identifier "__shfl_down" is undefined

(If I do not add this preprocessor command, the project compiles, but runs incorrectly).

Why might this command be breaking my project? Do I need to add a command line command to the compiler?

Thank you.

CUDA programmers should not be manually putting defines like this:


in their code. Such practices may break existing mechanisms (as you have discovered). In this case, if your project defines that, then when the CUDA compiler automatically includes device_functions.h (one of the CUDA header files) it won’t have the desired effect, because that define will trip up the include guards in that file, resulting in a situation that was as if that file had not been included in your project (and it is mandatory for CUDA).

If your code does not run correctly, you’ll probably need to debug it.

Ah I see. Thank you for your reply. I will leave that out! Without it, although my code will compile, I have many intelsense errors, mainly things that are defined in device_functions.h, as well as syncthreads and atomicInc. Right clicking on ‘go to definition’ takes me to the function definition, so can I ignore this as an intelsense issue, rather than a code one? Thanks again.

Yes, you can ignore things that are intellisense errors that relate to CUDA and do not prevent you from successfully compiling your code.

Again, if building your project that way results in a successful compile, but a program that does not give you the expected results, the only advice I can offer is to follow usual debugging methods.

will do. Thank you again for your time.