//@HEADER // ************************************************************************ // // Kokkos v. 4.0 // Copyright (2022) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // // Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. // See https://kokkos.org/LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //@HEADER #ifndef KOKKOSCOMPAT_TMM_HPP #define KOKKOSCOMPAT_TMM_HPP /// \file KokkosCompat_TMM.hpp /// \brief Compatibility between Kokkos Array View and Teuchos memory management classes. /// /// \warning This file and everything in it should be considered an /// implementation detail of Tpetra. We make no promises of /// backwards compatibility for any interface in this file, nor do /// we even promise that this header file will continue to exist. #include #include #include #if 0 namespace Kokkos { namespace Impl { // template // struct ViewAssignment {}; // ??? template< class DT , class DL , class DD , class DM , class ST , class SL , class SD , class SM > template struct ViewAssignment, Teuchos::ArrayView > { ViewAssignment (View& dst, const Teuchos::ArrayView& src, typename enable_if< ( is_same< typename ViewTraits::array_layout , typename ViewTraits::array_layout >::value && ( unsigned(ViewTraits::rank) == unsigned(ViewTraits::rank) ) && ( unsigned(ViewTraits::rank_dynamic) >= unsigned(ViewTraits::rank_dynamic) ) ) >::type * = 0 ) View srcView; // (src.getRawPtr (), src.size ()); srcView.m_shape.N0 = src.size (); } static void deep_copy (const DestViewType& dst, const Teuchos::ArrayView& src); }; } // namespace Impl } // namespace Kokkos namespace Kokkos { namespace Compat { template inline void deep_copy (const ViewType& dst, const Teuchos::ArrayView
& src); template inline void deep_copy (const Kokkos::View& dst, const Teuchos::ArrayView& src) { using Kokkos::LayoutRight; using Kokkos::Threads; using Kokkos::MemoryUnmanaged; using Kokkos::View; View srcView (src.getRawPtr (), src.size ()); Kokkos::deep_copy (dst, srcView); } } // namespace Compat } // namespace Kokkos #endif // 0 #endif // KOKKOSCOMPAT_TMM_HPP