24#ifndef MORPHEUS_DIA_OPENMP_CONVERT_IMPL_HPP
25#define MORPHEUS_DIA_OPENMP_CONVERT_IMPL_HPP
27#include <Morpheus_Macros.hpp>
28#if defined(MORPHEUS_ENABLE_OPENMP)
30#include <Morpheus_Exceptions.hpp>
31#include <Morpheus_SpaceTraits.hpp>
32#include <Morpheus_FormatTraits.hpp>
33#include <Morpheus_FormatTags.hpp>
34#include <Morpheus_Spaces.hpp>
39template <
typename ExecSpace,
typename SourceType,
typename DestinationType>
41 const SourceType& src, DestinationType& dst,
42 typename std::enable_if<
43 Morpheus::is_dia_matrix_format_container_v<SourceType> &&
44 Morpheus::is_dia_matrix_format_container_v<DestinationType> &&
45 Morpheus::has_custom_backend_v<ExecSpace> &&
46 Morpheus::has_openmp_execution_space_v<ExecSpace> &&
47 Morpheus::has_access_v<ExecSpace, SourceType, DestinationType>>::type* =
49 using size_type =
typename SourceType::size_type;
51 dst.resize(src.nrows(), src.ncols(), src.nnnz(),
52 src.cdiagonal_offsets().size());
55#pragma omp parallel for
56 for (size_type n = 0; n < (size_type)src.cdiagonal_offsets().size(); n++) {
57 dst.diagonal_offsets(n) = src.cdiagonal_offsets(n);
60#pragma omp parallel for
61 for (size_type j = 0; j < src.cvalues().ncols(); j++) {
62 for (size_type i = 0; i < src.cvalues().nrows(); i++) {
63 dst.values(i, j) = src.cvalues(i, j);
68template <
typename ExecSpace,
typename SourceType,
typename DestinationType>
70 const SourceType&, DestinationType&,
71 typename std::enable_if<
72 Morpheus::is_dia_matrix_format_container_v<SourceType> &&
73 Morpheus::is_coo_matrix_format_container_v<DestinationType> &&
74 Morpheus::has_custom_backend_v<ExecSpace> &&
75 Morpheus::has_openmp_execution_space_v<ExecSpace> &&
76 Morpheus::has_access_v<ExecSpace, SourceType, DestinationType>>::type* =
81template <
typename ExecSpace,
typename SourceType,
typename DestinationType>
83 const SourceType&, DestinationType&,
84 typename std::enable_if<
85 Morpheus::is_coo_matrix_format_container_v<SourceType> &&
86 Morpheus::is_dia_matrix_format_container_v<DestinationType> &&
87 Morpheus::has_custom_backend_v<ExecSpace> &&
88 Morpheus::has_openmp_execution_space_v<ExecSpace> &&
89 Morpheus::has_access_v<ExecSpace, SourceType, DestinationType>>::type* =
Definition: Morpheus_Exceptions.hpp:43
Generic Morpheus interfaces.
Definition: dummy.cpp:24