diff --git a/docs/how-to/hip_runtime_api/error_handling.rst b/docs/how-to/hip_runtime_api/error_handling.rst index 428c300835..564020ff7b 100644 --- a/docs/how-to/hip_runtime_api/error_handling.rst +++ b/docs/how-to/hip_runtime_api/error_handling.rst @@ -12,10 +12,18 @@ HIP runtime function, apart from launching kernels, has :cpp:type:`hipError_t` as return type. :cpp:func:`hipGetLastError()` and :cpp:func:`hipPeekAtLastError()` can be used for catching errors from kernel launches, as kernel launches don't return an error directly. HIP maintains an internal state, that includes the -last error code. hipGetLastError returns and resets that error to hipSuccess, -while :cpp:func:`hipPeekAtLastError` just returns the error without changing it. -To get a human readable version of the errors, :cpp:func:`hipGetErrorString()` -and :cpp:func:`hipGetErrorName()` can be used. +last error code. :cpp:func:`hipGetLastError` returns and resets that error to +hipSuccess, while :cpp:func:`hipPeekAtLastError` just returns the error without +changing it. To get a human readable version of the errors, +:cpp:func:`hipGetErrorString()` and :cpp:func:`hipGetErrorName()` can be used. + +.. note:: + + :cpp:func:`hipGetLastError` returns the returned error code of the last HIP + runtime API call even if it's hipSuccess, while ``cudaGetLastError`` returns + the error returned by any of the preceding CUDA APIs in the same host thread. + :cpp:func:`hipGetLastError` behavior will be matched with + ``cudaGetLastError`` in ROCm release 7.0. Best practices of HIP error handling: diff --git a/docs/how-to/hip_runtime_api/initialization.rst b/docs/how-to/hip_runtime_api/initialization.rst index 7e1282b431..4409c090a3 100644 --- a/docs/how-to/hip_runtime_api/initialization.rst +++ b/docs/how-to/hip_runtime_api/initialization.rst @@ -11,8 +11,11 @@ using GPUs. The following steps are covered with the initialization: - Setting up the HIP runtime - This includes loading necessary libraries and setting up internal data - structures. + This includes reading the environment variables set during init, setting up + the active or visible devices, loading necessary libraries, setting up + internal buffers for memory copies or cooperative launches, initialize the + compiler as well as HSA runtime and checks any errors due to lack of resources + or no active devices. - Querying and setting GPUs