Skip to content

Instantly share code, notes, and snippets.

@tallendev
Created August 6, 2020 03:57
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 tallendev/d93c6c589f276ce5c6a0824af12455f8 to your computer and use it in GitHub Desktop.
Save tallendev/d93c6c589f276ce5c6a0824af12455f8 to your computer and use it in GitHub Desktop.
minimal breaking of nvprof for uvm
__global__ void foo(float* array)
{
int i = 0;
array[i] = 0.0;
}
#define ARRAY_SIZE 500
int main (void)
{
float* array;
cudaMallocManaged(&array, ARRAY_SIZE * sizeof(float));
foo<<<1,1>>>(array);
cudaDeviceSynchronize();
return 0;
}
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment