INF5063, Pål Halvorsen, Carsten Griwodz, Håvard Espeland, Håkon Stensland University of Oslo // Hello World CUDA - INF5063 // #include the entire body of the cuPrintf code (availible in the SDK) #include util/cuPrintf.cu #include __global__ void device_hello(void) { cuPrintf( Hello, world from the GPU!\n ); } int main(void) { // greet from the CPU printf( Hello, world from the CPU!\n ); // init cuPrintf cudaPrintfInit(); // launch a kernel with a single thread to say hi from the device device_hello >>(); // display the device s greeting cudaPrintfDisplay(); // clean up after cuPrintf cudaPrintfEnd(); return 0; } Example: Hello World