diff --git a/docs/how-to/hip_runtime_api/call_stack.rst b/docs/how-to/hip_runtime_api/call_stack.rst index 45b7fad4b6..ae3e0be6cd 100644 --- a/docs/how-to/hip_runtime_api/call_stack.rst +++ b/docs/how-to/hip_runtime_api/call_stack.rst @@ -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, @@ -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; @@ -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); }