diff --git a/Lesson Code Snippets/Lesson 2 Code Snippets/atomics.cu b/Lesson Code Snippets/Lesson 2 Code Snippets/atomics.cu index 79369eac..a0f64648 100644 --- a/Lesson Code Snippets/Lesson 2 Code Snippets/atomics.cu +++ b/Lesson Code Snippets/Lesson 2 Code Snippets/atomics.cu @@ -40,7 +40,7 @@ int main(int argc,char **argv) NUM_THREADS, NUM_THREADS / BLOCK_WIDTH, ARRAY_SIZE); // declare and allocate host memory - int h_array[ARRAY_SIZE]; + int *h_array = new int[ARRAY_SIZE]; const int ARRAY_BYTES = ARRAY_SIZE * sizeof(int); // declare, allocate, and zero out GPU memory @@ -62,4 +62,4 @@ int main(int argc,char **argv) // free GPU memory allocation and exit cudaFree(d_array); return 0; -} \ No newline at end of file +}