CUDA is a parallel computing platform and API that allows for GPU programming. To get started in CUDA, we will take a look at creating a Hello World program. 

CUDA Hello World

Steps Example
1. Create a file with the .cu extension using vi.
$ vi hello_world.cu
2. Insert hello world code into the file.
#include <stdio.h>

__global__ void helloCUDA()
{
    printf("Hello, CUDA!\n");
}

int main()
{
    helloCUDA<<<1, 1>>>();
    cudaDeviceSynchronize();
    return 0;
}
3. Compile the program via the nvcc command
$ nvcc hello_world.cu -o hello_world
4. Run the compiled CUDA file created in the last step. If done correctly, "Hello, CUDA!" should be output to the terminal screen.
$ ./hello_world