Loading src/TNL/Containers/Segments/CSR.h +2 −2 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ #include <TNL/Containers/Vector.h> #include <TNL/Containers/Segments/CSRView.h> #include <TNL/Containers/Segments/CSRSegmentView.h> #include <TNL/Containers/Segments/SegmentView.h> namespace TNL { namespace Containers { Loading @@ -35,7 +35,7 @@ class CSR using ViewTemplate = CSRView< Device_, Index_ >; using ViewType = CSRView< Device, Index >; using ConstViewType = CSRView< Device, std::add_const_t< Index > >; using SegmentViewType = CSRSegmentView< IndexType >; using SegmentViewType = SegmentView< IndexType, true >; CSR(); Loading src/TNL/Containers/Segments/CSR.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ auto CSR< Device, Index, IndexAllocator >:: getSegmentView( const IndexType segmentIdx ) const -> SegmentViewType { return SegmentView( offsets[ segmentIdx ], offsets[ segmentIdx + 1 ] - offsets[ segmentIdx ] ); return SegmentViewType( offsets[ segmentIdx ], offsets[ segmentIdx + 1 ] - offsets[ segmentIdx ] ); } template< typename Device, Loading src/TNL/Containers/Segments/CSRSegmentView.hdeleted 100644 → 0 +0 −47 Original line number Diff line number Diff line /*************************************************************************** CSRSegmentView.h - description ------------------- begin : Dec 28, 2019 copyright : (C) 2019 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ #pragma once namespace TNL { namespace Containers { namespace Segments { template< typename Index > class CSRSegmentView { public: using IndexType = Index; __cuda_callable__ CSRSegmentView( const IndexType offset, const IndexType size ) : segmentOffset( offset ), segmentSize( size ){}; __cuda_callable__ IndexType getSize() const { return this->segmentSize; }; __cuda_callable__ IndexType getGlobalIndex( const IndexType localIndex ) const { TNL_ASSERT_LT( localIndex, segmentSize, "Local index exceeds segment bounds." ); return segmentOffset + localIndex; }; protected: IndexType segmentOffset, segmentSize; }; } //namespace Segments } //namespace Containers } //namespace TNL No newline at end of file src/TNL/Containers/Segments/CSRView.h +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ #include <type_traits> #include <TNL/Containers/Vector.h> #include <TNL/Containers/Segments/CSRSegmentView.h> #include <TNL/Containers/Segments/SegmentView.h> namespace TNL { namespace Containers { Loading @@ -33,7 +33,7 @@ class CSRView template< typename Device_, typename Index_ > using ViewTemplate = CSRView< Device_, Index_ >; using ConstViewType = CSRView< Device, std::add_const_t< Index > >; using SegmentViewType = CSRSegmentView< IndexType >; using SegmentViewType = SegmentView< IndexType >; __cuda_callable__ CSRView(); Loading src/TNL/Containers/Segments/CSRView.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ auto CSRView< Device, Index >:: getSegmentView( const IndexType segmentIdx ) const -> SegmentViewType { return SegmentViewType( offsets[ segmentIdx ], offsets[ segmentIdx + 1 ] - offsets[ segmentIdx ] ); return SegmentViewType( offsets[ segmentIdx ], offsets[ segmentIdx + 1 ] - offsets[ segmentIdx ], 1 ); } template< typename Device, Loading Loading
src/TNL/Containers/Segments/CSR.h +2 −2 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ #include <TNL/Containers/Vector.h> #include <TNL/Containers/Segments/CSRView.h> #include <TNL/Containers/Segments/CSRSegmentView.h> #include <TNL/Containers/Segments/SegmentView.h> namespace TNL { namespace Containers { Loading @@ -35,7 +35,7 @@ class CSR using ViewTemplate = CSRView< Device_, Index_ >; using ViewType = CSRView< Device, Index >; using ConstViewType = CSRView< Device, std::add_const_t< Index > >; using SegmentViewType = CSRSegmentView< IndexType >; using SegmentViewType = SegmentView< IndexType, true >; CSR(); Loading
src/TNL/Containers/Segments/CSR.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -176,7 +176,7 @@ auto CSR< Device, Index, IndexAllocator >:: getSegmentView( const IndexType segmentIdx ) const -> SegmentViewType { return SegmentView( offsets[ segmentIdx ], offsets[ segmentIdx + 1 ] - offsets[ segmentIdx ] ); return SegmentViewType( offsets[ segmentIdx ], offsets[ segmentIdx + 1 ] - offsets[ segmentIdx ] ); } template< typename Device, Loading
src/TNL/Containers/Segments/CSRSegmentView.hdeleted 100644 → 0 +0 −47 Original line number Diff line number Diff line /*************************************************************************** CSRSegmentView.h - description ------------------- begin : Dec 28, 2019 copyright : (C) 2019 by Tomas Oberhuber email : tomas.oberhuber@fjfi.cvut.cz ***************************************************************************/ /* See Copyright Notice in tnl/Copyright */ #pragma once namespace TNL { namespace Containers { namespace Segments { template< typename Index > class CSRSegmentView { public: using IndexType = Index; __cuda_callable__ CSRSegmentView( const IndexType offset, const IndexType size ) : segmentOffset( offset ), segmentSize( size ){}; __cuda_callable__ IndexType getSize() const { return this->segmentSize; }; __cuda_callable__ IndexType getGlobalIndex( const IndexType localIndex ) const { TNL_ASSERT_LT( localIndex, segmentSize, "Local index exceeds segment bounds." ); return segmentOffset + localIndex; }; protected: IndexType segmentOffset, segmentSize; }; } //namespace Segments } //namespace Containers } //namespace TNL No newline at end of file
src/TNL/Containers/Segments/CSRView.h +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ #include <type_traits> #include <TNL/Containers/Vector.h> #include <TNL/Containers/Segments/CSRSegmentView.h> #include <TNL/Containers/Segments/SegmentView.h> namespace TNL { namespace Containers { Loading @@ -33,7 +33,7 @@ class CSRView template< typename Device_, typename Index_ > using ViewTemplate = CSRView< Device_, Index_ >; using ConstViewType = CSRView< Device, std::add_const_t< Index > >; using SegmentViewType = CSRSegmentView< IndexType >; using SegmentViewType = SegmentView< IndexType >; __cuda_callable__ CSRView(); Loading
src/TNL/Containers/Segments/CSRView.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,7 @@ auto CSRView< Device, Index >:: getSegmentView( const IndexType segmentIdx ) const -> SegmentViewType { return SegmentViewType( offsets[ segmentIdx ], offsets[ segmentIdx + 1 ] - offsets[ segmentIdx ] ); return SegmentViewType( offsets[ segmentIdx ], offsets[ segmentIdx + 1 ] - offsets[ segmentIdx ], 1 ); } template< typename Device, Loading