Advertisement
Guest User

test.cu

a guest
Nov 29th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include "cuda_runtime.h"
  2. #include "device_launch_parameters.h"
  3.  
  4. #include "Vector.h"
  5.  
  6. __global__ void vectorOperations(Vector* a, Vector* b, Vector* result)
  7. {
  8.     int index = blockIdx.x;
  9.     result[index] = a[index] + b[index];
  10. }
  11.  
  12. extern "C" void CALL_KERNEL(Vector* dev_a, Vector* dev_b, Vector* dev_result)
  13. {
  14.     vectorOperations<<<3, 1>>>(dev_a, dev_b, dev_result);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement