24#ifndef MORPHEUS_DYNAMIC_CONVERT_IMPL_HPP
25#define MORPHEUS_DYNAMIC_CONVERT_IMPL_HPP
27#include <Morpheus_FormatTags.hpp>
29#include <impl/Morpheus_Variant.hpp>
30#include <impl/Morpheus_Convert_Impl.hpp>
35template <
typename ExecSpace>
37 using result_type = void;
39 template <
typename SourceType,
typename DestinationType>
40 result_type operator()(
const SourceType& src, DestinationType& dst) {
41 Impl::convert<ExecSpace>(src, dst);
45template <
typename ExecSpace,
typename SourceType,
typename DestinationType>
47 const SourceType& src, DestinationType& dst,
48 typename std::enable_if<
54 Impl::Variant::visit(f, src.const_formats());
57template <
typename ExecSpace,
typename SourceType,
typename DestinationType>
58void convert(
const SourceType& src, DestinationType& dst,
59 typename std::enable_if<
62 DestinationType>::value>::type* =
nullptr) {
63 dst.set_nrows(src.nrows());
64 dst.set_ncols(src.ncols());
65 dst.set_nnnz(src.nnnz());
67 std::placeholders::_1);
68 Impl::Variant::visit(f, dst.formats());
71template <
typename ExecSpace,
typename SourceType,
typename DestinationType>
73 const SourceType& src, DestinationType& dst,
74 typename std::enable_if<
78 dst.set_nrows(src.nrows());
79 dst.set_ncols(src.ncols());
80 dst.set_nnnz(src.nnnz());
81 Impl::Variant::visit(Impl::convert_fn<ExecSpace>(), src.const_formats(),
A valid Sparse Matrix container is the one that has a valid Sparse Matrix tag i.e satisfies the has_s...
Definition: Morpheus_FormatTraits.hpp:85
Generic Morpheus interfaces.
Definition: dummy.cpp:24
Definition: Dynamic/Morpheus_Convert_Impl.hpp:36