diff --git a/.github/workflows/deploy_docs.yml b/.github/workflows/deploy_docs.yml index 044767d67..3afa10333 100644 --- a/.github/workflows/deploy_docs.yml +++ b/.github/workflows/deploy_docs.yml @@ -14,6 +14,11 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Checkout kokkos + uses: actions/checkout@v3 + with: + repository: kokkos/kokkos + path: kokkos - name: Set up Python ${{ env.python-version }} uses: actions/setup-python@v4 with: diff --git a/docs/source/API/core/Initialize-and-Finalize.rst b/docs/source/API/core/Initialize-and-Finalize.rst index 9494e6d33..23b1ba699 100644 --- a/docs/source/API/core/Initialize-and-Finalize.rst +++ b/docs/source/API/core/Initialize-and-Finalize.rst @@ -51,6 +51,14 @@ Switching to ``Kokkos::ScopeGuard`` fixes it: // ScopeGuard destructor called, calls Kokkos::finalize } + +Included directly from Kokkos source: + +.. literalinclude:: ../../../../kokkos/example/tutorial/01_hello_world_lambda/hello_world_lambda.cpp + :language: cpp + :start-after: Kokkos::initialize + :end-before: Kokkos::finalize + In the above example, ``my_view`` will not go out of scope until the end of the main() function. Without ``ScopeGuard``, ``Kokkos::finalize`` will be called before ``my_view`` is out of scope. With ``ScopeGuard``, ``ScopeGuard`` will be dereferenced (subsequently calling ``Kokkos::finalize``) after ``my_view`` is dereferenced, which ensures the proper order during shutdown. .. toctree::