Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: MKKnorr <[email protected]>
  • Loading branch information
2 people authored and matyas-streamhpc committed Nov 5, 2024
1 parent 10d8954 commit 855bfc5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/how-to/hip_runtime_api/call_stack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ branching.

The call stack is a concept in computer science, representing the stack data
structure that stores information about the active subroutines or functions.
Each time a function is called, a new frame is added to the top of the stack,
Each time a function is called, a new call frame is added to the top of the stack,
containing information such as local variables, return addresses and function
parameters. When the function execution completes, the frame is removed from the
stack. This concept allows the program to return to the calling function and
continue executing from where it left off.
continue execution from where it left off.

The program counter keeps track of the current or next instruction to
be executed, while the call stack maintains the history of function calls,
Expand Down Expand Up @@ -68,7 +68,7 @@ by ensuring sufficient stack memory is allocated.
std::cout << "Default stack size: " << stackSize << " bytes" << std::endl;
// Set a new stack size
size_t newStackSize = 1024 * 8; // 1MB
size_t newStackSize = 1024 * 8; // 8 KiB
HIP_CHECK(hipDeviceSetLimit(hipLimitStackSize, newStackSize));
std::cout << "New stack size set to: " << newStackSize << " bytes" << std::endl;
Expand Down Expand Up @@ -115,7 +115,7 @@ exceed the available stack memory, considering the limited resources on GPUs.
unsigned long long result = factorial(n);
const size_t x = threadIdx.x + blockDim.x * blockIdx.x;
if( x == 0)
if(x == 0)
printf("%llu! = %llu \n", n, result);
}
Expand Down

0 comments on commit 855bfc5

Please sign in to comment.