//@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_VIEW_DEF_HPP #define KOKKOSCOMPAT_VIEW_DEF_HPP #include "KokkosCompat_View.hpp" namespace Kokkos { namespace Compat { // template // Kokkos::View // getKokkosViewDeepCopy(const Teuchos::ArrayView& a) { // typedef typename std::conditional< // Impl::VerifyExecutionCanAccessMemorySpace< D, Kokkos::HostSpace>::value, // typename D::execution_space, Kokkos::HostSpace>::type // HostDevice; // typedef Kokkos::View view_type; // typedef Kokkos::View unmanaged_host_view_type; // if (a.size() == 0) // return view_type(); // view_type v("", a.size()); // unmanaged_host_view_type hv(a.getRawPtr(), a.size()); // Kokkos::deep_copy(v,hv); // return v; // } // template // Kokkos::View // getKokkosViewDeepCopy(const Teuchos::ArrayView& a) { // typedef typename std::conditional< // Impl::VerifyExecutionCanAccessMemorySpace< D, Kokkos::HostSpace>::value, // typename D::execution_space, Kokkos::HostSpace>::type // HostDevice; // typedef Kokkos::View view_type; // typedef Kokkos::View unmanaged_host_view_type; // if (a.size() == 0) // return view_type(); // view_type v("", a.size()); // unmanaged_host_view_type hv(a.getRawPtr(), a.size()); // Kokkos::deep_copy(v,hv); // return v; // } // template // void // realloc(Kokkos::View& v, const typename D::size_type size) { // Kokkos::realloc(v,size); // } // template // Kokkos::View // create_view(const std::string& label, size_t size) { // return Kokkos::View(label, size); // } // #define COMPAT_INSTANT(T,D) // template Kokkos::View getKokkosViewDeepCopy(const Teuchos::ArrayView& a); //template Kokkos::View getKokkosViewDeepCopy(const Teuchos::ArrayView& a); // template void realloc(Kokkos::View& v, const D::size_type size); // template Kokkos::View create_view(const std::string& label, size_t size); // template Kokkos::View create_view(const std::string& label, size_t size); // template Kokkos::View create_view(const std::string& label, size_t size); } // namespace Compat } // namespace Kokkos #endif // KOKKOSCOMPAT_VIEW_DEF_HPP