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:

#include
#include<cuda.h>
#include<cuda_runtime.h>
#include<device_launch_parameters.h>

global void kernel(void)
{
}

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

return 0;

}

, i get: source.cu(37): 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!