From 8f1fb336f38da7b2d108152d5cf6e12f7c8dd32b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Oberhuber?= <oberhuber.tomas@gmail.com>
Date: Sun, 7 Feb 2021 16:31:48 +0100
Subject: [PATCH] Renaming CSRKernelScalar to CSRScalarKernel.

---
 src/TNL/Algorithms/Segments/CSR.h                |  4 ++--
 .../{CSRKernelScalar.h => CSRScalarKernel.h}     | 10 +++++-----
 .../{CSRKernelScalar.hpp => CSRScalarKernel.hpp} | 16 ++++++++--------
 src/TNL/Algorithms/Segments/CSRView.h            |  6 +++---
 src/TNL/Algorithms/Segments/CSRView.hpp          |  2 +-
 src/TNL/Matrices/SparseMatrix.hpp                |  4 ----
 6 files changed, 19 insertions(+), 23 deletions(-)
 rename src/TNL/Algorithms/Segments/{CSRKernelScalar.h => CSRScalarKernel.h} (87%)
 rename src/TNL/Algorithms/Segments/{CSRKernelScalar.hpp => CSRScalarKernel.hpp} (88%)

diff --git a/src/TNL/Algorithms/Segments/CSR.h b/src/TNL/Algorithms/Segments/CSR.h
index fd5a80fd84..576a1de795 100644
--- a/src/TNL/Algorithms/Segments/CSR.h
+++ b/src/TNL/Algorithms/Segments/CSR.h
@@ -23,7 +23,7 @@ namespace TNL {
 
 template< typename Device,
           typename Index,
-          typename Kernel = CSRKernelScalar< Index, Device >,
+          typename Kernel = CSRScalarKernel< Index, Device >,
           typename IndexAllocator = typename Allocators::Default< Device >::template Allocator< Index > >
 class CSR
 {
@@ -140,7 +140,7 @@ class CSR
 template< typename Device,
           typename Index,
           typename IndexAllocator = typename Allocators::Default< Device >::template Allocator< Index > >
-using CSRScalar = CSR< Device, Index, CSRKernelScalar< Index, Device >, IndexAllocator >;
+using CSRScalar = CSR< Device, Index, CSRScalarKernel< Index, Device >, IndexAllocator >;
 
 template< typename Device,
           typename Index,
diff --git a/src/TNL/Algorithms/Segments/CSRKernelScalar.h b/src/TNL/Algorithms/Segments/CSRScalarKernel.h
similarity index 87%
rename from src/TNL/Algorithms/Segments/CSRKernelScalar.h
rename to src/TNL/Algorithms/Segments/CSRScalarKernel.h
index 1de467a399..8a56d75d1b 100644
--- a/src/TNL/Algorithms/Segments/CSRKernelScalar.h
+++ b/src/TNL/Algorithms/Segments/CSRScalarKernel.h
@@ -1,5 +1,5 @@
 /***************************************************************************
-                          CSRKernelScalar.h -  description
+                          CSRScalarKernel.h -  description
                              -------------------
     begin                : Jan 23, 2021 -> Joe Biden inauguration
     copyright            : (C) 2021 by Tomas Oberhuber
@@ -22,12 +22,12 @@ namespace TNL {
 
 template< typename Index,
           typename Device >
-struct CSRKernelScalar
+struct CSRScalarKernel
 {
     using IndexType = Index;
     using DeviceType = Device;
-    using ViewType = CSRKernelScalar< Index, Device >;
-    using ConstViewType = CSRKernelScalar< Index, Device >;
+    using ViewType = CSRScalarKernel< Index, Device >;
+    using ConstViewType = CSRScalarKernel< Index, Device >;
 
     template< typename Offsets >
     void init( const Offsets& offsets );
@@ -60,4 +60,4 @@ struct CSRKernelScalar
    }  // namespace Algorithms
 } // namespace TNL
 
-#include <TNL/Algorithms/Segments/CSRKernelScalar.hpp>
\ No newline at end of file
+#include <TNL/Algorithms/Segments/CSRScalarKernel.hpp>
\ No newline at end of file
diff --git a/src/TNL/Algorithms/Segments/CSRKernelScalar.hpp b/src/TNL/Algorithms/Segments/CSRScalarKernel.hpp
similarity index 88%
rename from src/TNL/Algorithms/Segments/CSRKernelScalar.hpp
rename to src/TNL/Algorithms/Segments/CSRScalarKernel.hpp
index b5a396e159..75fda2e440 100644
--- a/src/TNL/Algorithms/Segments/CSRKernelScalar.hpp
+++ b/src/TNL/Algorithms/Segments/CSRScalarKernel.hpp
@@ -1,5 +1,5 @@
 /***************************************************************************
-                          CSRKernelScalar.h -  description
+                          CSRScalarKernel.h -  description
                              -------------------
     begin                : Jan 23, 2021 -> Joe Biden inauguration
     copyright            : (C) 2021 by Tomas Oberhuber
@@ -14,7 +14,7 @@
 #include <TNL/Cuda/LaunchHelpers.h>
 #include <TNL/Containers/VectorView.h>
 #include <TNL/Algorithms/ParallelFor.h>
-#include <TNL/Algorithms/Segments/CSRKernelScalar.h>
+#include <TNL/Algorithms/Segments/CSRScalarKernel.h>
 #include <TNL/Algorithms/Segments/details/LambdaAdapter.h>
 
 namespace TNL {
@@ -25,7 +25,7 @@ template< typename Index,
           typename Device >
     template< typename Offsets >
 void
-CSRKernelScalar< Index, Device >::
+CSRScalarKernel< Index, Device >::
 init( const Offsets& offsets )
 {
 }
@@ -33,7 +33,7 @@ init( const Offsets& offsets )
 template< typename Index,
           typename Device >
 void
-CSRKernelScalar< Index, Device >::
+CSRScalarKernel< Index, Device >::
 reset()
 {
 }
@@ -41,7 +41,7 @@ reset()
 template< typename Index,
           typename Device >
 auto
-CSRKernelScalar< Index, Device >::
+CSRScalarKernel< Index, Device >::
 getView() -> ViewType
 {
     return *this;
@@ -50,7 +50,7 @@ getView() -> ViewType
 template< typename Index,
           typename Device >
 auto
-CSRKernelScalar< Index, Device >::
+CSRScalarKernel< Index, Device >::
 getConstView() const -> ConstViewType
 {
     return *this;
@@ -59,7 +59,7 @@ getConstView() const -> ConstViewType
 template< typename Index,
           typename Device >
 TNL::String
-CSRKernelScalar< Index, Device >::
+CSRScalarKernel< Index, Device >::
 getKernelType()
 {
     return "Scalar";
@@ -74,7 +74,7 @@ template< typename Index,
               typename Real,
               typename... Args >
 void
-CSRKernelScalar< Index, Device >::
+CSRScalarKernel< Index, Device >::
 segmentsReduction( const OffsetsView& offsets,
                    Index first,
                    Index last,
diff --git a/src/TNL/Algorithms/Segments/CSRView.h b/src/TNL/Algorithms/Segments/CSRView.h
index 4576d9fdb5..3a19f4af78 100644
--- a/src/TNL/Algorithms/Segments/CSRView.h
+++ b/src/TNL/Algorithms/Segments/CSRView.h
@@ -14,7 +14,7 @@
 
 #include <TNL/Containers/Vector.h>
 #include <TNL/Algorithms/Segments/SegmentView.h>
-#include <TNL/Algorithms/Segments/CSRKernelScalar.h>
+#include <TNL/Algorithms/Segments/CSRScalarKernel.h>
 #include <TNL/Algorithms/Segments/CSRKernelVector.h>
 #include <TNL/Algorithms/Segments/CSRKernelHybrid.h>
 #include <TNL/Algorithms/Segments/CSRKernelAdaptive.h>
@@ -25,7 +25,7 @@ namespace TNL {
 
 template< typename Device,
           typename Index,
-          typename Kernel = CSRKernelScalar< Index, Device > >
+          typename Kernel = CSRScalarKernel< Index, Device > >
 class CSRView
 {
    public:
@@ -134,7 +134,7 @@ class CSRView
 
 template< typename Device,
           typename Index >
-using CSRViewScalar = CSRView< Device, Index, CSRKernelScalar< Index, Device > >;
+using CSRViewScalar = CSRView< Device, Index, CSRScalarKernel< Index, Device > >;
 
 template< typename Device,
           typename Index >
diff --git a/src/TNL/Algorithms/Segments/CSRView.hpp b/src/TNL/Algorithms/Segments/CSRView.hpp
index 8b1dce064e..96844fe50d 100644
--- a/src/TNL/Algorithms/Segments/CSRView.hpp
+++ b/src/TNL/Algorithms/Segments/CSRView.hpp
@@ -220,7 +220,7 @@ CSRView< Device, Index, Kernel >::
 segmentsReduction( IndexType first, IndexType last, Fetch& fetch, const Reduction& reduction, ResultKeeper& keeper, const Real& zero, Args... args ) const
 {
    if( std::is_same< DeviceType, TNL::Devices::Host >::value )
-      TNL::Algorithms::Segments::CSRKernelScalar< IndexType, DeviceType >::segmentsReduction( offsets, first, last, fetch, reduction, keeper, zero, args... );
+      TNL::Algorithms::Segments::CSRScalarKernel< IndexType, DeviceType >::segmentsReduction( offsets, first, last, fetch, reduction, keeper, zero, args... );
    else
       kernel.segmentsReduction( offsets, first, last, fetch, reduction, keeper, zero, args... );
 }
diff --git a/src/TNL/Matrices/SparseMatrix.hpp b/src/TNL/Matrices/SparseMatrix.hpp
index e348eed8d6..0b6b8d5357 100644
--- a/src/TNL/Matrices/SparseMatrix.hpp
+++ b/src/TNL/Matrices/SparseMatrix.hpp
@@ -984,14 +984,12 @@ operator=( const RHSMatrix& matrix )
          auto f1 = [=] __cuda_callable__ ( RHSIndexType rowIdx, RHSIndexType localIdx, RHSIndexType columnIndex, const RHSRealType& value, bool& compute ) mutable {
             if( columnIndex != paddingIndex )
             {
-               //printf("SparseMatrix.hpp: localIdx = %d, maxRowLength = %d \n", localIdx, maxRowLength );
                TNL_ASSERT_LT( rowIdx - baseRow, bufferRowsCount, "" );
                TNL_ASSERT_LT( localIdx, maxRowLength, "" );
                const IndexType bufferIdx = ( rowIdx - baseRow ) * maxRowLength + localIdx;
                TNL_ASSERT_LT( bufferIdx, ( IndexType ) bufferSize, "" );
                matrixColumnsBuffer_view[ bufferIdx ] = columnIndex;
                matrixValuesBuffer_view[ bufferIdx ] = value;
-               //printf( "TO BUFFER: rowIdx = %d localIdx = %d bufferIdx = %d column = %d value = %d \n", rowIdx, localIdx, bufferIdx, columnIndex, value );
             }
          };
          matrix.forRows( baseRow, lastRow, f1 );
@@ -1016,8 +1014,6 @@ operator=( const RHSMatrix& matrix )
                TNL_ASSERT_LT( bufferIdx, bufferSize, "" );
                inValue = thisValuesBuffer_view[ bufferIdx ];
             }
-            //std::cerr << "rowIdx = " << rowIdx << " localIdx = " << localIdx << " bufferLocalIdx = " << bufferLocalIdx
-            //          << " inValue = " << inValue << " bufferIdx = " << bufferIdx << std::endl;
             rowLocalIndexes_view[ rowIdx ] = bufferLocalIdx;
             if( inValue == 0.0 )
             {
-- 
GitLab