The problem that we are trying to solve is vector addition. As we are aware, vector addition is a data parallel operation. Our dataset consists of three arrays: A, B, and C. The same operation is performed on each element:
Cx = Ax + Bx
Each addition is independent of each other, but the same operation is applied by all CUDA threads. To get started, configure your environment according to the following steps:
- Prepare your GPU application. This code will be placed in 01_cuda_introduction/01_vector_addition.
- Compile your application with the nvcc compiler with the following command:
$nvcc -o vector_addition vector_addition.cu
The preceding code is sequential code. We will convert this code so that it can run on ...