Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove false statement about unhandled exceptions in ScopeGuard #575

Merged
merged 2 commits into from
Sep 1, 2024
Merged
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
9 changes: 4 additions & 5 deletions docs/source/API/core/initialize_finalize/ScopeGuard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,20 @@ Usage
.set_num_threads(1));


``ScopeGuard`` is a class which ensure thats `Kokkos::initialize <initialize.html#kokkosinitialize>`_ and
`Kokkos::finalize <finalize.html#kokkosfinalize>`_ are called correctly even in the presence of unhandled
exceptions.
``ScopeGuard`` is a class to initialize and finalize Kokkos using `RAII <https://en.cppreference.com/w/cpp/language/raii>`_.
It calls `Kokkos::initialize <initialize.html#kokkosinitialize>`_ with the provided arguments in the
constructor and `Kokkos::finalize <finalize.html#kokkosfinalize>`_ in the destructor.
For correct usage, it is mandatory to create a named instance of a ``ScopeGuard`` before any calls to Kokkos are issued.


.. warning:: Change of behavior in version 3.7 (see below)
.. warning:: Change of behavior in version 3.7 (see below). ``ScopeGuard`` will abort if either ``is_intialized()`` or ``is_finalized()`` return ``true``.

Description
-----------

.. cpp:class:: ScopeGuard

A class ensuring that ``Kokkos::initialize`` and ``Kokkos::finalize`` are called correctly even in the presence of unhandled exceptions.
A class calling ``Kokkos::initialize`` at the start of its lifetime and ``Kokkos::finalize`` at the end of its lifetime.

.. rubric:: Constructors

Expand Down
Loading