Skip to content
Snippets Groups Projects
Commit 46ee01f3 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Tomáš Oberhuber
Browse files

Fixes of SegmentsViewType and SegmentViewType.

parent 335dd0fc
No related branches found
No related tags found
1 merge request!48Segments
......@@ -34,7 +34,7 @@ class Ellpack
using OffsetsHolder = Containers::Vector< IndexType, DeviceType, IndexType >;
using SegmentsSizes = OffsetsHolder;
template< typename Device_, typename Index_ >
using ViewTemplate = EllpackView< Device_, Index_ >;
using ViewTemplate = EllpackView< Device_, Index_, RowMajorOrder, Alignment >;
using ViewType = EllpackView< Device, Index, RowMajorOrder, Alignment >;
//using ConstViewType = EllpackView< Device, std::add_const_t< Index >, RowMajorOrder, Alignment >;
using SegmentViewType = SegmentView< IndexType, RowMajorOrder >;
......
......@@ -35,7 +35,7 @@ class EllpackView
using OffsetsHolder = Containers::Vector< IndexType, DeviceType, IndexType >;
using SegmentsSizes = OffsetsHolder;
template< typename Device_, typename Index_ >
using ViewTemplate = EllpackView< Device_, Index_ >;
using ViewTemplate = EllpackView< Device_, Index_, RowMajorOrder, Alignment >;
using ViewType = EllpackView;
using ConstViewType = EllpackView< Device, std::add_const_t< Index > >;
using SegmentViewType = SegmentView< IndexType, RowMajorOrder >;
......
......@@ -35,7 +35,7 @@ class SlicedEllpack
static constexpr bool getRowMajorOrder() { return RowMajorOrder; }
using ViewType = SlicedEllpackView< Device, Index, RowMajorOrder, SliceSize >;
template< typename Device_, typename Index_ >
using ViewTemplate = SlicedEllpackView< Device_, Index_ >;
using ViewTemplate = SlicedEllpackView< Device_, Index_, RowMajorOrder, SliceSize >;
using ConstViewType = SlicedEllpackView< Device, std::add_const_t< Index >, RowMajorOrder, SliceSize >;
using SegmentViewType = SegmentView< IndexType, RowMajorOrder >;
......
......@@ -33,7 +33,7 @@ class SlicedEllpackView
static constexpr int getSliceSize() { return SliceSize; }
static constexpr bool getRowMajorOrder() { return RowMajorOrder; }
template< typename Device_, typename Index_ >
using ViewTemplate = SlicedEllpackView< Device_, Index_ >;
using ViewTemplate = SlicedEllpackView< Device_, Index_, RowMajorOrder, SliceSize >;
using ViewType = SlicedEllpackView;
using ConstViewType = SlicedEllpackView< Device, std::add_const_t< Index > >;
using SegmentViewType = SegmentView< IndexType, RowMajorOrder >;
......
......@@ -40,6 +40,7 @@ class SparseMatrix : public Matrix< Real, Device, Index, RealAllocator >
using SegmentsType = Segments< Device, Index, IndexAllocator >;
template< typename Device_, typename Index_ >
using SegmentsViewTemplate = typename SegmentsType::template ViewTemplate< Device_, Index >;
using SegmentsViewType = typename SegmentsType::ViewType;
using SegmentViewType = typename SegmentsType::SegmentViewType;
using DeviceType = Device;
using IndexType = Index;
......
......@@ -51,7 +51,6 @@ class SparseMatrixView : public MatrixView< Real, Device, Index >
typedef Containers::VectorView< IndexType, DeviceType, IndexType > CompressedRowLengthsVectorView;
typedef typename CompressedRowLengthsVectorView::ConstViewType ConstCompressedRowLengthsVectorView;
__cuda_callable__
SparseMatrixView();
......@@ -103,8 +102,8 @@ class SparseMatrixView : public MatrixView< Real, Device, Index >
const RealType& value,
const RealType& thisElementMultiplicator = 1.0 );
RealType getElement( const IndexType row,
const IndexType column ) const;
RealType getElement( IndexType row,
IndexType column ) const;
template< typename Vector >
__cuda_callable__
......
......@@ -209,6 +209,7 @@ SparseMatrixView< Real, Device, Index, MatrixType, SegmentsView >::
getRow( const IndexType& rowIdx ) -> RowView
{
TNL_ASSERT_LT( rowIdx, this->getRows(), "Row index is larger than number of matrix rows." );
typename RowView::SegmentViewType t = this->segments.getSegmentView( rowIdx );
return RowView( this->segments.getSegmentView( rowIdx ), this->values.getView(), this->columnIndexes.getView() );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment