54 #ifndef AMESOS2_KOKKOSCRSMATRIX_MATRIXADAPTER_DECL_HPP
55 #define AMESOS2_KOKKOSCRSMATRIX_MATRIXADAPTER_DECL_HPP
57 #include "Amesos2_config.h"
59 #include "Amesos2_MatrixAdapter_decl.hpp"
60 #include "KokkosSparse_CrsMatrix.hpp"
73 template <
typename Scalar,
74 typename LocalOrdinal,
75 typename ExecutionSpace>
76 class ConcreteMatrixAdapter<KokkosSparse::CrsMatrix<Scalar, LocalOrdinal, ExecutionSpace>> :
77 public MatrixAdapter<KokkosSparse::CrsMatrix<Scalar, LocalOrdinal, ExecutionSpace>>
80 typedef KokkosSparse::CrsMatrix<Scalar, LocalOrdinal, ExecutionSpace> matrix_t;
83 typedef typename MatrixTraits<matrix_t>::scalar_t scalar_t;
84 typedef typename MatrixTraits<matrix_t>::local_ordinal_t local_ordinal_t;
85 typedef typename MatrixTraits<matrix_t>::global_ordinal_t global_ordinal_t;
86 typedef typename MatrixTraits<matrix_t>::node_t node_t;
87 typedef typename MatrixTraits<matrix_t>::global_size_t global_size_t;
88 typedef typename MatrixTraits<matrix_t>::sparse_ptr_type spmtx_ptr_t;
89 typedef typename MatrixTraits<matrix_t>::sparse_idx_type spmtx_idx_t;
90 typedef typename MatrixTraits<matrix_t>::sparse_values_type spmtx_vals_t;
93 typedef ConcreteMatrixAdapter<matrix_t> type;
94 typedef typename MatrixTraits<matrix_t>::major_access major_access;
96 ConcreteMatrixAdapter(Teuchos::RCP<matrix_t> m);
98 Teuchos::RCP<const MatrixAdapter<matrix_t> > get_impl(
const Teuchos::Ptr<
const Tpetra::Map<local_ordinal_t,global_ordinal_t,node_t> > map,
EDistribution distribution = ROOTED)
const;
100 const Teuchos::RCP<const Teuchos::Comm<int> > getComm_impl()
const;
101 global_size_t getGlobalNumRows_impl()
const;
102 global_size_t getGlobalNumCols_impl()
const;
103 global_size_t getGlobalNNZ_impl()
const;
104 spmtx_ptr_t getSparseRowPtr()
const;
105 spmtx_idx_t getSparseColInd()
const;
106 spmtx_vals_t getSparseValues()
const;
109 void getSparseRowPtr_kokkos_view(KV & view)
const {
110 deep_copy_or_assign_view(view, this->mat_->graph.row_map);
114 void getSparseColInd_kokkos_view(KV & view)
const {
115 deep_copy_or_assign_view(view, this->mat_->graph.entries);
119 void getSparseValues_kokkos_view(KV & view)
const {
120 deep_copy_or_assign_view(view, this->mat_->values);
123 size_t getGlobalRowNNZ_impl(global_ordinal_t row)
const;
124 size_t getLocalRowNNZ_impl(local_ordinal_t row)
const;
125 size_t getGlobalColNNZ_impl(global_ordinal_t col)
const;
126 size_t getLocalColNNZ_impl(local_ordinal_t col)
const;
128 global_size_t getRowIndexBase()
const;
129 global_size_t getColumnIndexBase()
const;
131 const Teuchos::RCP<
const Tpetra::Map<local_ordinal_t,
136 const Teuchos::RCP<
const Tpetra::Map<local_ordinal_t,
139 getRowMap_impl()
const;
141 const Teuchos::RCP<
const Tpetra::Map<local_ordinal_t,
144 getColMap_impl()
const;
147 void getGlobalRowCopy_impl(global_ordinal_t row,
148 const Teuchos::ArrayView<global_ordinal_t>& indices,
149 const Teuchos::ArrayView<scalar_t>& vals,
152 void getGlobalColCopy_impl(global_ordinal_t col,
153 const Teuchos::ArrayView<global_ordinal_t>& indices,
154 const Teuchos::ArrayView<scalar_t>& vals,
161 #endif // AMESOS2_KOKKOSCRSMATRIX_MATRIXADAPTER_DECL_HPP
Copy or assign views based on memory spaces.
A Matrix adapter interface for Amesos2.
Definition: Amesos2_MatrixAdapter_decl.hpp:76
Indicates that the concrete class can use the generic getC{c|r}s methods implemented in MatrixAdapter...
Definition: Amesos2_TypeDecl.hpp:91
EDistribution
Definition: Amesos2_TypeDecl.hpp:123