Skip to content

Instantly share code, notes, and snippets.

@t-ubukata
Created May 29, 2019 01:46
Show Gist options
  • Save t-ubukata/ccc6b77f73c619df753621de90bc2db5 to your computer and use it in GitHub Desktop.
Save t-ubukata/ccc6b77f73c619df753621de90bc2db5 to your computer and use it in GitHub Desktop.
// CUDA: grid stride looping
#define CUDA_KERNEL_LOOP(i, n) \
for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < (n); \
i += blockDim.x * gridDim.x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment