Commit 14528aba authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing const views for segments.

parent 8248ae39
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ template <typename Device,
          typename IndexAllocator,
          ElementsOrganization Organization,
          int WarpSize >
std::ostream& operator<<( std::ostream& str, const BiEllpack< Device, Index, IndexAllocator, Organization, WarpSize >& segments ) { return printSegments( str, segments ); }
std::ostream& operator<<( std::ostream& str, const BiEllpack< Device, Index, IndexAllocator, Organization, WarpSize >& segments ) { return printSegments( segments, str ); }


      } // namespace Segments
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ class BiEllpackView

      using DeviceType = Device;
      using IndexType = std::remove_const_t< Index >;
      using OffsetsView = typename Containers::VectorView< IndexType, DeviceType, IndexType >;
      using OffsetsView = typename Containers::VectorView< Index, DeviceType, IndexType >;
      using ConstOffsetsView = typename OffsetsView::ConstViewType;
      using ViewType = BiEllpackView;
      template< typename Device_, typename Index_ >
+3 −2
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include <TNL/Containers/Vector.h>
#include <TNL/Algorithms/Segments/ChunkedEllpackView.h>
#include <TNL/Algorithms/Segments/SegmentView.h>
#include <TNL/Algorithms/Segments/SegmentsPrinting.h>

namespace TNL {
   namespace Algorithms {
@@ -34,7 +35,7 @@ class ChunkedEllpack
      using ViewType = ChunkedEllpackView< Device, Index, Organization >;
      template< typename Device_, typename Index_ >
      using ViewTemplate = ChunkedEllpackView< Device_, Index_, Organization >;
      using ConstViewType = ChunkedEllpackView< Device, std::add_const_t< IndexType >, Organization >;
      using ConstViewType = typename ViewType::ConstViewType;
      using SegmentViewType = typename ViewType::SegmentViewType;
      using ChunkedEllpackSliceInfoType = typename ViewType::ChunkedEllpackSliceInfoType; // details::ChunkedEllpackSliceInfo< IndexType >;
      //TODO: using ChunkedEllpackSliceInfoAllocator = typename IndexAllocatorType::retype< ChunkedEllpackSliceInfoType >;
@@ -176,7 +177,7 @@ template <typename Device,
          typename Index,
          typename IndexAllocator,
          ElementsOrganization Organization >
std::ostream& operator<<( std::ostream& str, const ChunkedEllpack< Device, Index, IndexAllocator, Organization >& segments ) { return printSegments( str, segments ); }
std::ostream& operator<<( std::ostream& str, const ChunkedEllpack< Device, Index, IndexAllocator, Organization >& segments ) { return printSegments( segments, str ); }


      } // namespace Segments
+3 −3
Original line number Diff line number Diff line
@@ -348,9 +348,9 @@ auto ChunkedEllpack< Device, Index, IndexAllocator, Organization >::
getSegmentSize( const IndexType segmentIdx ) const -> IndexType
{
   return details::ChunkedEllpack< IndexType, DeviceType, Organization >::getSegmentSize(
      rowToSliceMapping.getView(),
      slices.getView(),
      rowToChunkMapping.getView(),
      rowToSliceMapping.getConstView(),
      slices.getConstView(),
      rowToChunkMapping.getConstView(),
      segmentIdx );
}

+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ class ChunkedEllpackView

      using DeviceType = Device;
      using IndexType = std::remove_const_t< Index >;
      using OffsetsView = typename Containers::VectorView< IndexType, DeviceType, IndexType >;
      using OffsetsView = typename Containers::VectorView< Index, DeviceType, IndexType >;
      using ConstOffsetsView = typename OffsetsView::ConstViewType;
      using ViewType = ChunkedEllpackView;
      template< typename Device_, typename Index_ >
@@ -41,7 +41,7 @@ class ChunkedEllpackView
      using SegmentViewType = ChunkedEllpackSegmentView< IndexType, Organization >;
      using ChunkedEllpackSliceInfoType = details::ChunkedEllpackSliceInfo< IndexType >;
      using ChunkedEllpackSliceInfoAllocator = typename Allocators::Default< Device >::template Allocator< ChunkedEllpackSliceInfoType >;
      using ChunkedEllpackSliceInfoContainer = Containers::Array< ChunkedEllpackSliceInfoType, DeviceType, IndexType, ChunkedEllpackSliceInfoAllocator >;
      using ChunkedEllpackSliceInfoContainer = Containers::Array< typename TNL::copy_const< ChunkedEllpackSliceInfoType >::template from< Index >::type, DeviceType, IndexType, ChunkedEllpackSliceInfoAllocator >;
      using ChunkedEllpackSliceInfoContainerView = typename ChunkedEllpackSliceInfoContainer::ViewType;

      static constexpr bool havePadding() { return true; };
Loading