Files
NeuralNetworkLib/src/Cuda/VectorOperations.cpp
2014-12-10 16:01:53 +01:00

12 lines
331 B
C++

#include "./VectorOperations.h"
// CUDA kernel. Each thread takes care of one element of c
__global__ void vecAdd(double *a, double *b, double *c, int n)
{
// Get our global thread ID
int id = blockIdx.x*blockDim.x+threadIdx.x;
// Make sure we do not go out of bounds
if (id < n)
c[id] = a[id] + b[id];
}