Skip to content

Commit

Permalink
Document DualView::view_[host|device]
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Feb 5, 2025
1 parent fa6ddd1 commit 763b502
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions docs/source/API/containers/DualView.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ Usage
Device>
view_type a("A", n, m);
Kokkos::deep_copy(a.d_view, 1);
Kokkos::deep_copy(a.view_device(), 1);
a.template modify<typename view_type::execution_space>();
a.template sync<typename view_type::host_mirror_space>();
Kokkos::deep_copy(a.h_view, 2);
Kokkos::deep_copy(a.view_host(), 2);
a.template modify<typename ViewType::host_mirror_space>();
a.template sync<typename ViewType::execution_space>();
Expand Down Expand Up @@ -124,11 +124,11 @@ Description

.. cppkokkos:member:: t_dev d_view
The view instance on the *device*
The view instance on the *device*, public access deprecated from Kokkos 4.6 on.

.. cppkokkos:member:: t_host h_view
The view instance on the *host*
The view instance on the *host*, public access deprecated from Kokkos 4.6 on.

.. cppkokkos:member:: t_modified_flags modified_flags
Expand Down Expand Up @@ -195,6 +195,14 @@ Description
- and if you want to get the host mirror of that View, do this:
- ``typedef typename Kokkos::HostSpace::execution_space host_device_type; typename dual_view_type::t_host hostView = DV.view<host_device_type> ();``

.. cppkokkos:function:: const t_host& view_host() const;
* Return the host-accessible View, before Kokkos 4.6, return the View by value.

.. cppkokkos:function:: const t_dev& view_device() const;
* Return the View on the device, before Kokkos 4.6, return the View by value.

.. cppkokkos:function:: template <class Device> void sync(const typename Impl::enable_if<(std::is_same<typename traits::data_type, typename traits::non_const_data_type>::value) || (std::is_same<Device, int>::value), int>::type& = 0);
.. cppkokkos:function:: template <class Device> void sync(const typename Impl::enable_if<(!std::is_same<typename traits::data_type, typename traits::non_const_data_type>::value) || (std::is_same<Device, int>::value), int>::type& = 0);
Expand Down

0 comments on commit 763b502

Please sign in to comment.