Commit 4a0a98cb authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixed constructors of DenseMatrixView and EllpackView.

parent 4e2fe80e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ auto
Ellpack< Device, Index, IndexAllocator, Organization, Alignment >::
getView() -> ViewType
{
   return ViewType( segmentSize, size, alignedSize );
   return ViewType( size, segmentSize, alignedSize );
}

template< typename Device,
@@ -121,7 +121,7 @@ auto
Ellpack< Device, Index, IndexAllocator, Organization, Alignment >::
getConstView() const -> const ConstViewType
{
   return ConstViewType( segmentSize, size, alignedSize );
   return ConstViewType( size, segmentSize, alignedSize );
}

template< typename Device,
+4 −1
Original line number Diff line number Diff line
@@ -47,7 +47,10 @@ class EllpackView
      EllpackView();

      __cuda_callable__
      EllpackView( IndexType segmentSize, IndexType segmentsCount, IndexType alignedSize );
      EllpackView( IndexType segmentsCount, IndexType segmentSize, IndexType alignedSize );

      __cuda_callable__
      EllpackView( IndexType segmentsCount, IndexType segmentSize );

      __cuda_callable__
      EllpackView( const EllpackView& ellpackView );
+17 −2
Original line number Diff line number Diff line
@@ -37,11 +37,26 @@ template< typename Device,
          int Alignment >
__cuda_callable__
EllpackView< Device, Index, Organization, Alignment >::
EllpackView( IndexType segmentSize, IndexType segmentsCount, IndexType alignedSize )
EllpackView( IndexType segmentsCount, IndexType segmentSize, IndexType alignedSize )
   : segmentSize( segmentSize ), segmentsCount( segmentsCount ), alignedSize( alignedSize )
{
}

template< typename Device,
          typename Index,
          ElementsOrganization Organization,
          int Alignment >
__cuda_callable__
EllpackView< Device, Index, Organization, Alignment >::
EllpackView( IndexType segmentsCount, IndexType segmentSize )
   : segmentSize( segmentSize ), segmentsCount( segmentsCount )
{
   if( Organization == RowMajorOrder )
      this->alignedSize = this->segmentsCount;
   else
      this->alignedSize = roundUpDivision( segmentsCount, this->getAlignment() ) * this->getAlignment();
}

template< typename Device,
          typename Index,
          ElementsOrganization Organization,
@@ -107,7 +122,7 @@ auto
EllpackView< Device, Index, Organization, Alignment >::
getConstView() const -> const ConstViewType
{
   return ConstViewType( segmentSize, segmentsCount, alignedSize );
   return ConstViewType( segmentsCount, segmentSize, alignedSize );
}

template< typename Device,
+2 −6
Original line number Diff line number Diff line
@@ -38,10 +38,8 @@ DenseMatrixView< Real, Device, Index, Organization >::
DenseMatrixView( const IndexType rows,
                 const IndexType columns,
                 const ValuesViewType& values )
 : MatrixView< Real, Device, Index >( rows, columns, values )
 : MatrixView< Real, Device, Index >( rows, columns, values ), segments( rows, columns )
{
   SegmentsType a( rows, columns );
   segments = a.getView();
}

template< typename Real,
@@ -54,10 +52,8 @@ DenseMatrixView< Real, Device, Index, Organization >::
DenseMatrixView( const IndexType rows,
                 const IndexType columns,
                 const Containers::VectorView< Value_, Device, Index >& values )
 : MatrixView< Real, Device, Index >( rows, columns, values )
 : MatrixView< Real, Device, Index >( rows, columns, values ), segments( rows, columns, true )
{
   SegmentsType a( rows, columns );
   segments = a.getView();
}

template< typename Real,
+10 −10

File changed.

Contains only whitespace changes.