24#ifndef MORPHEUS_DENSEVECTOR_COPY_IMPL_HPP
25#define MORPHEUS_DENSEVECTOR_COPY_IMPL_HPP
27#include <Morpheus_FormatTags.hpp>
29#include <impl/Morpheus_Utils.hpp>
30#include <impl/DenseVector/Serial/Morpheus_Copy_Impl.hpp>
31#include <impl/DenseVector/OpenMP/Morpheus_Copy_Impl.hpp>
32#include <impl/DenseVector/Cuda/Morpheus_Copy_Impl.hpp>
33#include <impl/DenseVector/HIP/Morpheus_Copy_Impl.hpp>
35#include <Kokkos_Core.hpp>
42template <
typename SourceType,
typename DestinationType>
43void copy(
const SourceType& src, DestinationType& dst,
44 typename std::enable_if_t<
45 Morpheus::is_dense_vector_format_container_v<SourceType> &&
46 Morpheus::is_dense_vector_format_container_v<DestinationType>>* =
49 dst.size() == src.size(),
50 "Destination vector must be of equal size to the source vector");
53 Kokkos::deep_copy(dst.view(), src.const_view());
56template <
typename SourceType,
typename DestinationType>
57void copy(
const SourceType& src, DestinationType& dst,
58 const typename SourceType::size_type src_begin,
59 const typename SourceType::size_type src_end,
60 const typename DestinationType::size_type dst_begin,
61 const typename DestinationType::size_type dst_end,
62 typename std::enable_if_t<
63 Morpheus::is_dense_vector_format_container_v<SourceType> &&
64 Morpheus::is_dense_vector_format_container_v<DestinationType>>* =
67 Kokkos::subview(src.const_view(), std::make_pair(src_begin, src_end));
69 Kokkos::subview(dst.view(), std::make_pair(dst_begin, dst_end));
72 Kokkos::deep_copy(dst_sub, src_sub);
Generic Morpheus interfaces.
Definition: dummy.cpp:24