I\'m using Visual Studio 2010 and a GTX480 with compute capability 2.0.
I have tried setting sm to 2.0, but when I attempt to use printf() in a kernel, I get:
To use printf
in kernel code, you have to do three things:
cstdio
or stdio.h
are included in the kernel compilation unit. CUDA implements kernel printf
by overloading, so you must include that file-arch=sm_20
to nvcc or the IDE equivalent in Visual Studio or Nsight Eclipse edition)cudaDeviceSynchronize
for example).