Created
February 3, 2012 17:53
-
-
Save rbonvall/1731392 to your computer and use it in GitHub Desktop.
c ← a + b in CUDA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__global__ void sum(float *a, float *b, float *c) { | |
int i = threadIdx.x + blockDim.x * blockIdx.x; | |
c[i] = a[i] + b[i]; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment