Skip to content

Instantly share code, notes, and snippets.

@rharriso
Created October 23, 2018 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rharriso/4f71544a1132ba780b75c84e079e5b01 to your computer and use it in GitHub Desktop.
Save rharriso/4f71544a1132ba780b75c84e079e5b01 to your computer and use it in GitHub Desktop.
Initialize Body Counts Cuda
const int PIXEL_COUNT = 500 * 500;
usigned int *pixelBodyCounts;
cudaMallocManaged(&pixelBodyCounts, PIXEL_COUNT * sizeof(unsigned int));
initZeros<<<numBlocks, blockSize>>>(pixelBodyCounts);
// do stuff with the pixels
cudaFree(pixelBodyCounts);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment