11 #ifndef AMESOS2_KOKKOS_CRSMATRIX_MATRIXADAPTER_DEF_HPP
12 #define AMESOS2_KOKKOS_CRSMATRIX_MATRIXADAPTER_DEF_HPP
15 #include "Amesos2_MatrixAdapter_def.hpp"
16 #include "KokkosSparse_CrsMatrix.hpp"
17 #include <Tpetra_Core.hpp>
21 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
22 ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::ConcreteMatrixAdapter(Teuchos::RCP<matrix_t> m)
23 : MatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>(m)
28 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
29 typename ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::global_size_t
30 ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getRowIndexBase()
const
35 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
36 typename ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::global_size_t
37 ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getColumnIndexBase()
const
42 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
43 const Teuchos::RCP<const Teuchos::Comm<int> >
44 ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getComm_impl()
const
46 return Tpetra::getDefaultComm();
49 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
50 const RCP<const Tpetra::Map<typename MatrixTraits<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::local_ordinal_t,
51 typename MatrixTraits<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::global_ordinal_t,
52 typename MatrixTraits<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::node_t> >
53 ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getRowMap_impl()
const
58 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
59 const RCP<const Tpetra::Map<typename MatrixTraits<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::local_ordinal_t,
60 typename MatrixTraits<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::global_ordinal_t,
61 typename MatrixTraits<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::node_t> >
62 ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getColMap_impl()
const
67 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
68 Teuchos::RCP<const MatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace> > >
69 ConcreteMatrixAdapter<
70 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>
72 [[maybe_unused]]
const Teuchos::Ptr<
const Tpetra::Map<local_ordinal_t,global_ordinal_t,node_t> > map,
75 TEUCHOS_TEST_FOR_EXCEPTION(
true,
77 "get_impl() not implemented for the Kokkos CrsMatrix adapter yet. "
78 "Please contact the Amesos2 developers." );
81 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
82 typename ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::global_size_t
83 ConcreteMatrixAdapter<
84 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getGlobalNumRows_impl()
const
86 return this->mat_->numRows();
89 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
90 typename ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::global_size_t
91 ConcreteMatrixAdapter<
92 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getGlobalNumCols_impl()
const
94 return this->mat_->numCols();
97 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
98 typename ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::global_size_t
99 ConcreteMatrixAdapter<
100 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getGlobalNNZ_impl()
const
102 return this->mat_->nnz();
105 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
106 const Teuchos::RCP<const Tpetra::Map<typename MatrixTraits<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::local_ordinal_t,
107 typename MatrixTraits<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::global_ordinal_t,
108 typename MatrixTraits<KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::node_t> >
109 ConcreteMatrixAdapter<
110 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getMap_impl()
const
112 return( Teuchos::null );
115 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
117 ConcreteMatrixAdapter<
118 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>
119 >::getGlobalRowNNZ_impl(
120 [[maybe_unused]] global_ordinal_t row
122 TEUCHOS_TEST_FOR_EXCEPTION(
true,
124 "getGlobalRowNNZ_impl() not implemented for the Kokkos CrsMatrix adapter yet. "
125 "Please contact the Amesos2 developers." );
128 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
130 ConcreteMatrixAdapter<
131 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getLocalRowNNZ_impl(local_ordinal_t row)
const
133 TEUCHOS_TEST_FOR_EXCEPTION(
true,
135 "getLocalRowNNZ_impl() not implemented for the Kokkos CrsMatrix adapter yet. "
136 "Please contact the Amesos2 developers." );
139 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
141 ConcreteMatrixAdapter<
142 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getGlobalColNNZ_impl(global_ordinal_t col)
const
144 TEUCHOS_TEST_FOR_EXCEPTION(
true,
146 "Column access to row-based object not yet supported. "
147 "Please contact the Amesos2 developers." );
150 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
152 ConcreteMatrixAdapter<
153 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>>::getLocalColNNZ_impl(local_ordinal_t col)
const
155 TEUCHOS_TEST_FOR_EXCEPTION(
true,
157 "Column access to row-based object not yet supported. "
158 "Please contact the Amesos2 developers." );
162 template <
typename Scalar,
typename LocalOrdinal,
typename ExecutionSpace>
163 template <
typename KV_GO,
typename KV_S>
165 ConcreteMatrixAdapter<
166 KokkosSparse::CrsMatrix<Scalar,LocalOrdinal,ExecutionSpace>
167 >::getGlobalRowCopy_kokkos_view_impl(
168 [[maybe_unused]] global_ordinal_t row,
169 [[maybe_unused]] KV_GO & indices,
170 [[maybe_unused]] KV_S & vals,
171 [[maybe_unused]]
size_t& nnz
173 TEUCHOS_TEST_FOR_EXCEPTION(
true,
175 "getGlobalRowCopy_kokkos_view_impl not implemented for Kokkos CrsMatrix yet. "
176 "Please contact the Amesos2 developers." );
181 #endif // AMESOS2_KOKKOS_CRSMATRIX_MATRIXADAPTER_DEF_HPP
Specialization of the ConcreteMatrixAdapter for KokkosSparse::CrsMatrix.
EDistribution
Definition: Amesos2_TypeDecl.hpp:89