Guest User

test.cu

a guest
Nov 29th, 2013
44
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data