Skip to content

Instantly share code, notes, and snippets.

@U-MA
Created November 21, 2013 13:38
Show Gist options
  • Save U-MA/7581698 to your computer and use it in GitHub Desktop.
Save U-MA/7581698 to your computer and use it in GitHub Desktop.
__global__ void kernel(...)
{
__shared__ int candidates[32], candidateSize;
int customer = threadIdx.x;
candidateSize = 0;
if (customer < 32 && !isVisited(customer))
{
atomicAdd(&candidate[candidateSize], customer);
atomicAdd(&candidateSize, 1);
}
....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment