diff --git a/src/TNL/Algorithms/Segments/CSR.h b/src/TNL/Algorithms/Segments/CSR.h index fd5a80fd84e5ea92976fd98d08cec473c0911ccc..576a1de79563b19eec101c3961f724d18ba02b7b 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 1de467a39987733ec0b798c62f41177fab7930ec..8a56d75d1b38a3e224176925ce5017f9a53d2e1a 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 b5a396e1592e76ed75eee07b5bba3e342f0bc2ca..75fda2e440d48e38e1f990fe187c9d3543c25839 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 4576d9fdb5efbb527fb8f35d77b29b168b6a0978..3a19f4af78c6a0a904a49e66edd70ca4f5085fe6 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 8b1dce064e9e4dd086b61c5c3d9e46c4cc66086b..96844fe50d05ced5a8ff6e34748a1dd25c43a8c1 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 e348eed8d636f85e3df5cdb8690c93f864578246..0b6b8d53571bc30556afc6ad840db3108012ff7d 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 ) {