Skip to content

Instantly share code, notes, and snippets.

@sachith-1
Created October 4, 2021 07:04
Show Gist options
  • Save sachith-1/902acfbd0b0bdafdfca36c3dc5769908 to your computer and use it in GitHub Desktop.
Save sachith-1/902acfbd0b0bdafdfca36c3dc5769908 to your computer and use it in GitHub Desktop.
__global__ void getSum(int *n1, int *n2, int *sumData, int size){
int index = threadIdx.x + blockIdx.x * blockDim.x;
if( index<size ){
sumData[index] = n1[index] + n2[index];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment