Integration of CUDA code in excisting VS project

Hi all,

I am working with the following setup

VS 2010, CUDA 4.0.

I can compile the SDK examples, and I can run my own projects I started from scratch. Now I wanna add cuda code to an existing none CUDA project, I set the “build customizations” to cuda 4.0, changed the ending to .cu and added cudart.lib to the additional linker dependicies.

The structure i tested is call function in which does all the memory allocations etc and includes the kernel call in a second file( excluded from build).

My first test was to call a simple cudamalloc and a few device property outputs in an .cu file which worked, but as soon as I entered kernel code like <<< , threadidx.x etc it gave me the errors, “identifier not found”

One thing a found suspicious is that the sdk examples call nvcc from the sdk, whereas for some reason my code is executing it from the toolkit.

can someone please give me some general guidance how the integration works best ?