Skip to content
Snippets Groups Projects

Feature/algebra coverage

11 files
+ 832
21
Compare changes
  • Side-by-side
  • Inline

Files

+ 20
5
@@ -17,7 +17,7 @@ class CRSMatrix
@@ -17,7 +17,7 @@ class CRSMatrix
using MutableDataType = std::remove_const_t<DataType>;
using MutableDataType = std::remove_const_t<DataType>;
private:
private:
using HostMatrix = Kokkos::StaticCrsGraph<IndexType, Kokkos::HostSpace>;
using HostMatrix = Kokkos::StaticCrsGraph<const IndexType, Kokkos::HostSpace>;
HostMatrix m_host_matrix;
HostMatrix m_host_matrix;
Array<const DataType> m_values;
Array<const DataType> m_values;
@@ -37,9 +37,15 @@ class CRSMatrix
@@ -37,9 +37,15 @@ class CRSMatrix
}
}
auto
auto
hostMatrix() const
rowIndices() const
{
{
return m_host_matrix;
return encapsulate(m_host_matrix.row_map);
 
}
 
 
auto
 
row(size_t i) const
 
{
 
return m_host_matrix.rowConst(i);
}
}
template <typename DataType2>
template <typename DataType2>
@@ -70,8 +76,17 @@ class CRSMatrix
@@ -70,8 +76,17 @@ class CRSMatrix
CRSMatrix(const SparseMatrixDescriptor<DataType, IndexType>& M)
CRSMatrix(const SparseMatrixDescriptor<DataType, IndexType>& M)
{
{
m_host_matrix = Kokkos::create_staticcrsgraph<HostMatrix>("connectivity_matrix", M.graphVector());
{
m_values = M.valueArray();
auto host_matrix =
 
Kokkos::create_staticcrsgraph<Kokkos::StaticCrsGraph<IndexType, Kokkos::HostSpace>>("connectivity_matrix",
 
M.graphVector());
 
 
// This is a bit crappy but it is the price to pay to avoid
 
m_host_matrix.entries = host_matrix.entries;
 
m_host_matrix.row_map = host_matrix.row_map;
 
m_host_matrix.row_block_offsets = host_matrix.row_block_offsets;
 
}
 
m_values = M.valueArray();
}
}
~CRSMatrix() = default;
~CRSMatrix() = default;
};
};
Loading