Guest User

Untitled

a guest
Apr 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. __global__ void addVectors(float* vec1, float* vec2, float* result) {
  2. int index = threadIdx.x;
  3. result[index] = vec1[index] + vec2[index];
  4. }
  5.  
  6. int main() {
  7. ...
  8. addVectors<<<1, N>>>(vec1, vec2, result);
  9. ...
  10. }
Add Comment
Please, Sign In to add comment