don't know
This commit is contained in:
12
src/Cuda/VectorOperations.cpp
Normal file
12
src/Cuda/VectorOperations.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#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];
|
||||
}
|
||||
Reference in New Issue
Block a user