Hi everyone,
I’m a beginner and didn’t get how to compile Cuda:
I’m using the following code in a file named main.c:
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
global void kernel(void)
{
}
int main(int argc, char** argv)
{
kernel<<<1,1>>>();
printf(“Hello World\n”);
return (EXIT_SUCCESS);
}
With nvcc main.c I’ve got the following error :
main.c:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
main.c: In function ‘main’:
main.c:24: error: ‘kernel’ undeclared (first use in this function)
main.c:24: error: (Each undeclared identifier is reported only once
main.c:24: error: for each function it appears in.)
main.c:24: error: expected expression before ‘<’ token
I know that it seems to be simple, but I really have trouble to understand how to build and run it.
I thank you beforehand for your advice.
Elrachal