42 #ifndef TPETRA_DETAILS_CASTAWAYCONSTDUALVIEW_HPP 43 #define TPETRA_DETAILS_CASTAWAYCONSTDUALVIEW_HPP 53 #include "Kokkos_DualView.hpp" 62 template<
class ValueType,
class DeviceType>
63 Kokkos::DualView<ValueType*, DeviceType>
66 typedef Kokkos::DualView<const ValueType*, DeviceType> input_dual_view_type;
67 typedef typename input_dual_view_type::t_dev::non_const_type out_dev_view_type;
68 typedef typename input_dual_view_type::t_host::non_const_type out_host_view_type;
70 out_dev_view_type output_view_dev
71 (const_cast<ValueType*> (input_dv.d_view.data ()),
72 input_dv.d_view.extent (0));
73 out_host_view_type output_view_host
74 (const_cast<ValueType*> (input_dv.h_view.data ()),
75 input_dv.h_view.extent (0));
77 Kokkos::DualView<ValueType*, DeviceType> output_dv;
78 output_dv.d_view = output_view_dev;
79 output_dv.h_view = output_view_host;
80 output_dv.modified_device = input_dv.modified_device;
81 output_dv.modified_host = input_dv.modified_host;
88 #endif // TPETRA_DETAILS_CASTAWAYCONSTDUALVIEW_HPP Namespace Tpetra contains the class and methods constituting the Tpetra library.
Implementation details of Tpetra.
Kokkos::DualView< ValueType *, DeviceType > castAwayConstDualView(const Kokkos::DualView< const ValueType *, DeviceType > &input_dv)
Cast away const-ness of a 1-D Kokkos::DualView.