From bfb8e0c0a4794f48e95e6eff29f572d0f952228a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Oberhuber?= <oberhuber.tomas@gmail.com>
Date: Sat, 7 Dec 2019 12:10:17 +0100
Subject: [PATCH] Implementing SlicedEllpack segments.

---
 src/TNL/Containers/Segments/SlicedEllpack.hpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/TNL/Containers/Segments/SlicedEllpack.hpp b/src/TNL/Containers/Segments/SlicedEllpack.hpp
index 60d2059fef..c91a13473f 100644
--- a/src/TNL/Containers/Segments/SlicedEllpack.hpp
+++ b/src/TNL/Containers/Segments/SlicedEllpack.hpp
@@ -64,9 +64,22 @@ setSizes( const SizesHolder& sizes )
    this->segmentOffsets.setSize( segmentsCount + 1 );
    Ellpack< DeviceType, IndexType, true > ellpack;
    ellpack.setSizes( segmentsCount, SliceSize );
-   ...
 
+   const IndexType _size = this->getSize();
+   const auto sizes_view = sizes.getConstView();
+   auto offsets_view = this->segmentOffsets().getView();
+   auto fetch = [=] __cuda_callable__ ( IndexType segmentIdx, IndexType globalIdx ) -> IndexType {
+      if( globalIdx < size )
+         return sizes_view[ globalIdx ];
+   };
+   auto reduce = [] __cuda_callable__ ( IndexType& aux, const IndexType i ) {
+      aux = TNL::max( aux, i );
+   };
+   auto keep = [=] __cuda_callable__ ( IndexType i, IndexType res ) {
+      offsets_view[ i ] = res;
+   }
 
+   std::cerr << offsets_view << std::endl;
 
 
 
-- 
GitLab