24#ifndef MORPHEUS_CONVERT_HPP
25#define MORPHEUS_CONVERT_HPP
27#include <Morpheus_Print.hpp>
28#include <Morpheus_FormatTags.hpp>
29#include <fwd/Morpheus_Fwd_CooMatrix.hpp>
31#include <impl/Morpheus_Convert_Impl.hpp>
32#include <impl/Dynamic/Morpheus_Convert_Impl.hpp>
53template <
typename ExecSpace,
typename SourceType,
typename DestinationType>
54void convert(
const SourceType& src, DestinationType& dst) {
55 Impl::convert<ExecSpace>(src, dst);
87template <
typename ExecSpace,
typename SourceType>
90 "Container must be a DynamicMatrix.");
92 typename SourceType::value_type,
typename SourceType::index_type,
93 typename SourceType::array_layout,
typename SourceType::memory_space>
97 if (src.active_index() == index) {
101 if (src.active_index() != Morpheus::COO_FORMAT) {
103 Impl::convert<ExecSpace>(src, temp);
105 std::cout <<
"Warning: Conversion failed! Active state set to: "
106 << src.active_index() << std::endl;
115 SourceType dynamic_temp;
116 dynamic_temp.activate(index);
119 Impl::convert<ExecSpace>(temp, dynamic_temp);
121 std::cout <<
"Warning: Conversion failed! Active state set to: "
122 << src.active_index() << std::endl;
141template <
typename ExecSpace,
typename SourceType>
143 return Morpheus::convert<ExecSpace>(src,
static_cast<formats_e
>(index));
Implementation of the Coordinate (COO) Sparse Matrix Format Representation.
Definition: Morpheus_CooMatrix.hpp:91
conversion_error_e
Enum values for in-place conversion status.
Definition: Morpheus_Convert.hpp:62
void convert(const SourceType &src, DestinationType &dst)
Performs a conversion operation between two containers.
Definition: Morpheus_Convert.hpp:54
@ CONV_SUCCESS
In-place conversion successful.
Definition: Morpheus_Convert.hpp:65
@ PROXY_TO_DYNAMIC
Proxy to Dynamic conversion failed.
Definition: Morpheus_Convert.hpp:64
@ DYNAMIC_TO_PROXY
Dynamic to Proxy conversion failed.
Definition: Morpheus_Convert.hpp:63
Generic Morpheus interfaces.
Definition: dummy.cpp:24