Skip to content

Commit

Permalink
core(view): implications of WithoutInitializing
Browse files Browse the repository at this point in the history
  • Loading branch information
romintomasetti committed Aug 28, 2024
1 parent c5573b1 commit b5748d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/source/ProgrammingGuide/View.rst
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,15 @@ in a way that reflects how first-touch affinity to threads is desired.
Typically it is sufficient to use the parallel iteration index as the index of the location in the
view to write to.

.. warning::

:cppkokkos:`WithoutInitialization` implies that the destructor of each element of the :cppkokkos:`View` **will not be called**.
For instance, if you need the destructor of your :code:`MyObjectWithDestructor` be called for each element of your :cppkokkos:`View<MyObjectWithDestructor*>`,
you **should not use** :cppkokkos:`WithoutInitialization`.

The reason for that is, since `Kokkos` did not initialize the memory, it cannot know onto which elements of the :cppkokkos:`View` calling the destructor
of the :code:`value_type` is valid.

6.4.3 Deep copy and HostMirror
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit b5748d0

Please sign in to comment.