Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Fixed stack overflow error (Lesson 2, atomics) #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Lesson Code Snippets/Lesson 2 Code Snippets/atomics.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -62,4 +62,4 @@ int main(int argc,char **argv)
// free GPU memory allocation and exit
cudaFree(d_array);
return 0;
}
}