Deep Learning, Machine Learning, Gpu, Cuda, AI.
our script becomes: #include <stdio.h> // Kernel definition __global__ void AddTwoVectors(float A[], float B[], float C[], int N) { int i = blockIdx.x * blockDim.x + threadIdx.x; if (i < N) // To avoid exceeding array limit C[i] = A[i] + B[i]; } int main() { int N = 500000; // Size of the vectors