Noob problem with '<<<1,1>>> syntax

I’m trying to learn cuda gpu computing for scientific purpose.

I have installed vs 2013 and cuda 7.5 toolkit. When I try to run:


global void kernel(void)

int main(void)
kernel<<<1, 1>>> ();
printf(“Hello World\n”);

return 0;


, i get: error C2059: syntax error : ‘<’

I guess my program is reading ‘<<’ as a kind of output instruction (such as cout << “hello”;) instead of reading the cuda instruction for the void function kernel. How can I fix this?

You need to compile code that contains CUDA extensions to C++, such as the <<<>>> launch configuration specification, with the CUDA compiler nvcc. When you do that, you also don’t need to include header files like device_launch_parameters.h

Solved, thanks!