Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __global__ void vecAdd(int *A,int *B,int *C, int n)
- {
- int sum = 0;
- for (int j =0; j<n/1000; j++) {
- int i = blockIdx.x * blockDim.x + threadIdx.x+j*1000;
- sum = sum + A[i];
- __syncthreads();
- C[i]=sum;
- sum = 0;
- }
- //__syncthreads();
- // do average?
- }
Add Comment
Please, Sign In to add comment