diff --git a/Docs/sphinx_documentation/source/Basics.rst b/Docs/sphinx_documentation/source/Basics.rst index 1227b5f7b71..ebddd14f9b5 100644 --- a/Docs/sphinx_documentation/source/Basics.rst +++ b/Docs/sphinx_documentation/source/Basics.rst @@ -2812,3 +2812,6 @@ Backtrace files are produced by AMReX signal handler by default when segfault occurs or ``Abort`` is called. If the application does not want AMReX to handle this, ``ParmParse`` parameter `amrex.signal_handling=0` can be used to disable it. + +See :ref:`sec:gpu:assertion` for considerations on using these functions in +GPU-enabled code. diff --git a/Docs/sphinx_documentation/source/GPU.rst b/Docs/sphinx_documentation/source/GPU.rst index 56d540e63c4..90dbcc9f26f 100644 --- a/Docs/sphinx_documentation/source/GPU.rst +++ b/Docs/sphinx_documentation/source/GPU.rst @@ -1553,9 +1553,13 @@ Assertions and Error Checking To help debugging, we often use :cpp:`amrex::Assert` and :cpp:`amrex::Abort`. These functions are GPU safe and can be used in GPU kernels. However, implementing these functions requires additional -GPU registers, which will reduce overall performance. Therefore, it -is preferred to implement such calls in debug mode only by wrapping the -calls using ``#ifdef AMREX_DEBUG``. +GPU registers, which will reduce overall performance. Therefore, by +default these functions and the macro ``AMREX_ALWAYS_ASSERT`` are no-ops +for optimized builds (e.g., ``DEBUG=FALSE`` using the GNU Make build +system) when called from kernels run on GPU. Calls to these functions from +GPU kernels are active for debug builds and can optionally be activated +at compile time for optimized builds (e.g., ``DEBUG=FALSE`` and +``USE_ASSERTION=TRUE`` using the GNU Make build system). In CPU code, :cpp:`AMREX_GPU_ERROR_CHECK()` can be called to check the health of previous GPU launches. This call