diff --git a/src/Benchmarks/BLAS/spmv.h b/src/Benchmarks/BLAS/spmv.h index 6685b9f766237dbcbe2d2a017eb1d8dac9a87135..f7f3139bfaa553c2505bda10d7e4503e320217a5 100644 --- a/src/Benchmarks/BLAS/spmv.h +++ b/src/Benchmarks/BLAS/spmv.h @@ -25,7 +25,7 @@ namespace Benchmarks { // silly alias to match the number of template parameters with other formats template< typename Real, typename Device, typename Index > -using SlicedEllpack = Matrices::SlicedEllpack< Real, Device, Index >; +using SlicedEllpack = Matrices::Legacy::SlicedEllpack< Real, Device, Index >; template< typename Matrix > int setHostTestMatrix( Matrix& matrix, @@ -173,10 +173,10 @@ benchmarkSpmvSynthetic( Benchmark & benchmark, const int & elementsPerRow ) { // TODO: benchmark all formats from tnl-benchmark-spmv (different parameters of the base formats) - benchmarkSpMV< Real, Matrices::CSR >( benchmark, size, elementsPerRow ); - benchmarkSpMV< Real, Matrices::Ellpack >( benchmark, size, elementsPerRow ); + benchmarkSpMV< Real, Matrices::Legacy::CSR >( benchmark, size, elementsPerRow ); + benchmarkSpMV< Real, Matrices::Legacy::Ellpack >( benchmark, size, elementsPerRow ); benchmarkSpMV< Real, SlicedEllpack >( benchmark, size, elementsPerRow ); - benchmarkSpMV< Real, Matrices::ChunkedEllpack >( benchmark, size, elementsPerRow ); + benchmarkSpMV< Real, Matrices::Legacy::ChunkedEllpack >( benchmark, size, elementsPerRow ); } } // namespace Benchmarks diff --git a/src/Benchmarks/DistSpMV/tnl-benchmark-distributed-spmv.h b/src/Benchmarks/DistSpMV/tnl-benchmark-distributed-spmv.h index 8aa22d6f72c78b5036047c63b71a1a2c5116c0a9..53dfb07f4018b62efc2e936bd4efcefa7d7b7bca 100644 --- a/src/Benchmarks/DistSpMV/tnl-benchmark-distributed-spmv.h +++ b/src/Benchmarks/DistSpMV/tnl-benchmark-distributed-spmv.h @@ -339,7 +339,7 @@ main( int argc, char* argv[] ) // return ! Matrices::resolveMatrixType< MainConfig, // Devices::Host, // SpmvBenchmark >( benchmark, metadata, parameters ); - using MatrixType = Matrices::SlicedEllpack< double, Devices::Host, int >; + using MatrixType = Matrices::Legacy::SlicedEllpack< double, Devices::Host, int >; const bool status = SpmvBenchmark< MatrixType >::run( benchmark, metadata, parameters ); if( rank == 0 ) diff --git a/src/Benchmarks/LinearSolvers/tnl-benchmark-linear-solvers.h b/src/Benchmarks/LinearSolvers/tnl-benchmark-linear-solvers.h index 08f45683a338491b89be826cb148df37137e3699..7e275244ee2925c1c3c0b000ee007a42b3e819a5 100644 --- a/src/Benchmarks/LinearSolvers/tnl-benchmark-linear-solvers.h +++ b/src/Benchmarks/LinearSolvers/tnl-benchmark-linear-solvers.h @@ -488,7 +488,7 @@ struct LinearSolversBenchmark { // direct solvers if( parameters.getParameter< bool >( "with-direct" ) ) { - using CSR = Matrices::CSR< RealType, DeviceType, IndexType >; + using CSR = Matrices::Legacy::CSR< RealType, DeviceType, IndexType >; SharedPointer< CSR > matrixCopy; Matrices::copySparseMatrix( *matrixCopy, *matrixPointer ); @@ -567,7 +567,7 @@ configSetup( Config::ConfigDescription& config ) config.addDelimiter( "Linear solver settings:" ); Solvers::IterativeSolver< double, int >::configSetup( config ); - using Matrix = Matrices::SlicedEllpack< double, Devices::Host, int >; + using Matrix = Matrices::Legacy::SlicedEllpack< double, Devices::Host, int >; using GMRES = Solvers::Linear::GMRES< Matrix >; GMRES::configSetup( config ); using BiCGstabL = Solvers::Linear::BICGStabL< Matrix >; @@ -621,7 +621,7 @@ main( int argc, char* argv[] ) // return ! Matrices::resolveMatrixType< MainConfig, // Devices::Host, // LinearSolversBenchmark >( benchmark, metadata, parameters ); - using MatrixType = Matrices::SlicedEllpack< double, Devices::Host, int >; + using MatrixType = Matrices::Legacy::SlicedEllpack< double, Devices::Host, int >; const bool status = LinearSolversBenchmark< MatrixType >::run( benchmark, metadata, parameters ); if( rank == 0 ) diff --git a/src/Benchmarks/SpMV/cusparseCSRMatrix.h b/src/Benchmarks/SpMV/cusparseCSRMatrix.h index 8ed210d9ad2802cf56237c2a02ecda6913c5a352..1cb52f8840345655f321289d947f65c445f4a1e6 100644 --- a/src/Benchmarks/SpMV/cusparseCSRMatrix.h +++ b/src/Benchmarks/SpMV/cusparseCSRMatrix.h @@ -22,7 +22,7 @@ class CusparseCSRBase public: typedef Real RealType; typedef Devices::Cuda DeviceType; - typedef Matrices::CSR< RealType, Devices::Cuda, int > MatrixType; + typedef Matrices::Legacy::CSR< RealType, Devices::Cuda, int > MatrixType; CusparseCSRBase() : matrix( 0 ) @@ -155,4 +155,4 @@ class CusparseCSR< float > : public CusparseCSRBase< float > } }; -} // namespace TNL \ No newline at end of file +} // namespace TNL diff --git a/src/Benchmarks/SpMV/spmv.h b/src/Benchmarks/SpMV/spmv.h index 02a26854dc06a5ad0de8230a6f351d24a2526975..3cd5c19d2aa9a662e147c9438aa62bfce2997f6c 100644 --- a/src/Benchmarks/SpMV/spmv.h +++ b/src/Benchmarks/SpMV/spmv.h @@ -41,7 +41,7 @@ namespace Benchmarks { // Alias to match the number of template parameters with other formats template< typename Real, typename Device, typename Index > -using SlicedEllpackAlias = Matrices::SlicedEllpack< Real, Device, Index >; +using SlicedEllpackAlias = Matrices::Legacy::SlicedEllpack< Real, Device, Index >; // Segments based sparse matrix aliases template< typename Real, typename Device, typename Index > @@ -114,8 +114,8 @@ benchmarkSpMV( Benchmark& benchmark, bool verboseMR ) { // Setup CSR for cuSPARSE. It will compared to the format given as a template parameter to this function - typedef Matrices::CSR< Real, Devices::Host, int > CSR_HostMatrix; - typedef Matrices::CSR< Real, Devices::Cuda, int > CSR_DeviceMatrix; + typedef Matrices::Legacy::CSR< Real, Devices::Host, int > CSR_HostMatrix; + typedef Matrices::Legacy::CSR< Real, Devices::Cuda, int > CSR_DeviceMatrix; CSR_HostMatrix CSRhostMatrix; CSR_DeviceMatrix CSRdeviceMatrix; @@ -287,16 +287,16 @@ benchmarkSpmvSynthetic( Benchmark& benchmark, const String& inputFileName, bool verboseMR ) { - benchmarkSpMV< Real, Matrices::CSR >( benchmark, inputFileName, verboseMR ); + benchmarkSpMV< Real, Matrices::Legacy::CSR >( benchmark, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrix_CSR >( benchmark, inputFileName, verboseMR ); - benchmarkSpMV< Real, Matrices::Ellpack >( benchmark, inputFileName, verboseMR ); + benchmarkSpMV< Real, Matrices::Legacy::Ellpack >( benchmark, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrix_Ellpack >( benchmark, inputFileName, verboseMR ); benchmarkSpMV< Real, SlicedEllpackAlias >( benchmark, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrix_SlicedEllpack >( benchmark, inputFileName, verboseMR ); - benchmarkSpMV< Real, Matrices::ChunkedEllpack >( benchmark, inputFileName, verboseMR ); - benchmarkSpMV< Real, Matrices::BiEllpack >( benchmark, inputFileName, verboseMR ); + benchmarkSpMV< Real, Matrices::Legacy::ChunkedEllpack >( benchmark, inputFileName, verboseMR ); + benchmarkSpMV< Real, Matrices::Legacy::BiEllpack >( benchmark, inputFileName, verboseMR ); //// // Segments based sparse matrices diff --git a/src/Python/pytnl/tnl/SparseMatrix.cpp b/src/Python/pytnl/tnl/SparseMatrix.cpp index fe3ba5aca7f2dbb96817760620cf3369b3b43140..573b2790a28d71b0a00ce299e28f789c4d807f87 100644 --- a/src/Python/pytnl/tnl/SparseMatrix.cpp +++ b/src/Python/pytnl/tnl/SparseMatrix.cpp @@ -7,12 +7,12 @@ #include <TNL/Matrices/Legacy/Ellpack.h> #include <TNL/Matrices/Legacy/SlicedEllpack.h> -using CSR_host = TNL::Matrices::CSR< double, TNL::Devices::Host, int >; -using CSR_cuda = TNL::Matrices::CSR< double, TNL::Devices::Cuda, int >; -using E_host = TNL::Matrices::Ellpack< double, TNL::Devices::Host, int >; -using E_cuda = TNL::Matrices::Ellpack< double, TNL::Devices::Cuda, int >; -using SE_host = TNL::Matrices::SlicedEllpack< double, TNL::Devices::Host, int >; -using SE_cuda = TNL::Matrices::SlicedEllpack< double, TNL::Devices::Cuda, int >; +using CSR_host = TNL::Matrices::Legacy::CSR< double, TNL::Devices::Host, int >; +using CSR_cuda = TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, int >; +using E_host = TNL::Matrices::Legacy::Ellpack< double, TNL::Devices::Host, int >; +using E_cuda = TNL::Matrices::Legacy::Ellpack< double, TNL::Devices::Cuda, int >; +using SE_host = TNL::Matrices::Legacy::SlicedEllpack< double, TNL::Devices::Host, int >; +using SE_cuda = TNL::Matrices::Legacy::SlicedEllpack< double, TNL::Devices::Cuda, int >; void export_SparseMatrices( py::module & m ) { diff --git a/src/Python/pytnl/tnl/SparseMatrix.h b/src/Python/pytnl/tnl/SparseMatrix.h index e4064e1a411364084e2422d1a18f8814a1271f0b..f2f280577fdbeabbf42e0cdeca0b3c0e647ec7ef 100644 --- a/src/Python/pytnl/tnl/SparseMatrix.h +++ b/src/Python/pytnl/tnl/SparseMatrix.h @@ -15,12 +15,12 @@ struct SpecificExports }; template< typename Real, typename Device, typename Index > -struct SpecificExports< TNL::Matrices::CSR< Real, Device, Index > > +struct SpecificExports< TNL::Matrices::Legacy::CSR< Real, Device, Index > > { template< typename Scope > static void exec( Scope & s ) { - using Matrix = TNL::Matrices::CSR< Real, Device, Index >; + using Matrix = TNL::Matrices::Legacy::CSR< Real, Device, Index >; s.def("getRowPointers", py::overload_cast<>(&Matrix::getRowPointers), py::return_value_policy::reference_internal); s.def("getColumnIndexes", py::overload_cast<>(&Matrix::getColumnIndexes), py::return_value_policy::reference_internal); diff --git a/src/TNL/Matrices/DistributedMatrix.h b/src/TNL/Matrices/DistributedMatrix.h index 05ee2839152940503f385d883575c9e5730041a2..dde7051c063b4b806131ebdcb1e2412667c72414 100644 --- a/src/TNL/Matrices/DistributedMatrix.h +++ b/src/TNL/Matrices/DistributedMatrix.h @@ -56,8 +56,8 @@ public: using CompressedRowLengthsVector = Containers::DistributedVector< IndexType, DeviceType, IndexType, CommunicatorType >; - using MatrixRow = Matrices::SparseRow< RealType, IndexType >; - using ConstMatrixRow = Matrices::SparseRow< std::add_const_t< RealType >, std::add_const_t< IndexType > >; + using MatrixRow = Matrices::Legacy::SparseRow< RealType, IndexType >; + using ConstMatrixRow = Matrices::Legacy::SparseRow< std::add_const_t< RealType >, std::add_const_t< IndexType > >; template< typename _Real = RealType, typename _Device = DeviceType, diff --git a/src/TNL/Matrices/Legacy/AdEllpack.h b/src/TNL/Matrices/Legacy/AdEllpack.h index 1135084ee9346375ad1f14bde3ba8453d0ac5868..260bdc4ac1f6e9cec000886f5a3124ee0d583210 100644 --- a/src/TNL/Matrices/Legacy/AdEllpack.h +++ b/src/TNL/Matrices/Legacy/AdEllpack.h @@ -23,6 +23,7 @@ namespace TNL { namespace Matrices { +namespace Legacy { template< typename Device > class AdEllpackDeviceDependentCode; @@ -293,6 +294,7 @@ protected: }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/AdEllpack_impl.h b/src/TNL/Matrices/Legacy/AdEllpack_impl.h index 242a3c81f810bd001c9beabe4c39e9048ff29e48..a1deb6cf8e24b8d736a18f4dfeb1ee23b5991cef 100644 --- a/src/TNL/Matrices/Legacy/AdEllpack_impl.h +++ b/src/TNL/Matrices/Legacy/AdEllpack_impl.h @@ -17,6 +17,7 @@ namespace TNL { namespace Matrices { +namespace Legacy { /* * Auxiliary list implementation @@ -1576,6 +1577,6 @@ public: }; - +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/BiEllpack.h b/src/TNL/Matrices/Legacy/BiEllpack.h index 1a92581c71386e31d09b4bd811792fc6a5e6f493..3f7b06a58f680607f0c5f53914efc9aeb15f9c22 100644 --- a/src/TNL/Matrices/Legacy/BiEllpack.h +++ b/src/TNL/Matrices/Legacy/BiEllpack.h @@ -23,6 +23,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Device > @@ -216,7 +217,7 @@ private: Containers::Vector< Index, Device, Index > groupPointers; }; - + } //namespace Legacy } //namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/BiEllpackSymmetric.h b/src/TNL/Matrices/Legacy/BiEllpackSymmetric.h index 8a845a08372c0647af36c911ec59b79e6e857747..09fe7c4e55b8247ef77846356dd20110f2d7eac6 100644 --- a/src/TNL/Matrices/Legacy/BiEllpackSymmetric.h +++ b/src/TNL/Matrices/Legacy/BiEllpackSymmetric.h @@ -15,6 +15,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Device > class BiEllpackSymmetricDeviceDependentCode; @@ -175,6 +176,7 @@ private: }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/BiEllpackSymmetric_impl.h b/src/TNL/Matrices/Legacy/BiEllpackSymmetric_impl.h index a27497b3f67b97ae33394a957775c30abd6281d2..61dde63343dfe178889ecea73b4bdc3bb7ccb3fe 100644 --- a/src/TNL/Matrices/Legacy/BiEllpackSymmetric_impl.h +++ b/src/TNL/Matrices/Legacy/BiEllpackSymmetric_impl.h @@ -17,6 +17,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Device, @@ -1631,5 +1632,6 @@ public: }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/BiEllpack_impl.h b/src/TNL/Matrices/Legacy/BiEllpack_impl.h index 6db2ed6095926d2bcdb3950e996019756dacd422..1bb393bb939aed770f4a3878ab3fca895920243f 100644 --- a/src/TNL/Matrices/Legacy/BiEllpack_impl.h +++ b/src/TNL/Matrices/Legacy/BiEllpack_impl.h @@ -18,6 +18,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, @@ -1499,7 +1500,7 @@ public: } }; - + } //namespace Legacy } //namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/CSR.h b/src/TNL/Matrices/Legacy/CSR.h index a31f3ee76ed3fc18925212b93e3c4c14837d0a36..e5edd26590d666720f72640403a92483d927b1e1 100644 --- a/src/TNL/Matrices/Legacy/CSR.h +++ b/src/TNL/Matrices/Legacy/CSR.h @@ -18,6 +18,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { #ifdef HAVE_UMFPACK template< typename Matrix, typename Preconditioner > @@ -272,6 +273,7 @@ protected: friend class CusparseCSR< RealType >; }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/CSR_impl.h b/src/TNL/Matrices/Legacy/CSR_impl.h index 5fec923f0333ff6b6df3591ac526366bb0bc27de..ba691834a4e0e3e2130b461a7232e85250227a79 100644 --- a/src/TNL/Matrices/Legacy/CSR_impl.h +++ b/src/TNL/Matrices/Legacy/CSR_impl.h @@ -21,6 +21,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { #ifdef HAVE_CUSPARSE template< typename Real, typename Index > @@ -1003,5 +1004,6 @@ class CSRDeviceDependentCode< Devices::Cuda > }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/ChunkedEllpack.h b/src/TNL/Matrices/Legacy/ChunkedEllpack.h index a0f55b3263d0911455318886cc680f5242de820b..93ba63ebf908697f9b716b4989538a4e9e513f0d 100644 --- a/src/TNL/Matrices/Legacy/ChunkedEllpack.h +++ b/src/TNL/Matrices/Legacy/ChunkedEllpack.h @@ -26,7 +26,8 @@ #include <TNL/Containers/Vector.h> namespace TNL { -namespace Matrices { +namespace Matrices { + namespace Legacy { template< typename Device > class ChunkedEllpackDeviceDependentCode; @@ -104,7 +105,7 @@ public: __cuda_callable__ IndexType getRowLengthFast( const IndexType row ) const; - + IndexType getNonZeroRowLength( const IndexType row ) const; template< typename Real2, typename Device2, typename Index2 > @@ -349,6 +350,7 @@ protected: #endif }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/ChunkedEllpack_impl.h b/src/TNL/Matrices/Legacy/ChunkedEllpack_impl.h index 4061597524742923f03a4115a52a16a2f44bb0ae..2de0a252c870f4bae1ac28c7c7179e09ad24c890 100644 --- a/src/TNL/Matrices/Legacy/ChunkedEllpack_impl.h +++ b/src/TNL/Matrices/Legacy/ChunkedEllpack_impl.h @@ -17,6 +17,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Index, @@ -1500,5 +1501,6 @@ class ChunkedEllpackDeviceDependentCode< Devices::Cuda > }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/Ellpack.h b/src/TNL/Matrices/Legacy/Ellpack.h index eea58b7571b1b6dd2416fbca0b3897f9782539d6..af730ccd22f864da7ade15f1f134cdc3393037f4 100644 --- a/src/TNL/Matrices/Legacy/Ellpack.h +++ b/src/TNL/Matrices/Legacy/Ellpack.h @@ -15,6 +15,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Device > class EllpackDeviceDependentCode; @@ -207,6 +208,7 @@ protected: friend class EllpackDeviceDependentCode< DeviceType >; }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/EllpackSymmetric.h b/src/TNL/Matrices/Legacy/EllpackSymmetric.h index d92fc77ee25f203adad1470de46d17552047a290..af3c2e4a81a5d966dd644483add94db471069f6d 100644 --- a/src/TNL/Matrices/Legacy/EllpackSymmetric.h +++ b/src/TNL/Matrices/Legacy/EllpackSymmetric.h @@ -15,6 +15,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Device > class EllpackSymmetricDeviceDependentCode; @@ -182,6 +183,7 @@ class EllpackSymmetric : public Sparse< Real, Device, Index > friend class EllpackSymmetricDeviceDependentCode< DeviceType >; }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/EllpackSymmetricGraph.h b/src/TNL/Matrices/Legacy/EllpackSymmetricGraph.h index 03e3298557171cd2faaed57b698819af0c87b7d2..dd42b7f26a93ae088b3198c7975949f415ae021e 100644 --- a/src/TNL/Matrices/Legacy/EllpackSymmetricGraph.h +++ b/src/TNL/Matrices/Legacy/EllpackSymmetricGraph.h @@ -15,6 +15,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Device > class EllpackSymmetricGraphDeviceDependentCode; @@ -203,6 +204,7 @@ class EllpackSymmetricGraph : public Sparse< Real, Device, Index > bool rearranged; }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/EllpackSymmetricGraph_impl.h b/src/TNL/Matrices/Legacy/EllpackSymmetricGraph_impl.h index 1aa9b51a6cbdbaa8c596db148b8dbceae62066fd..6f5419196dc6839e6831bb2fe5579ae1bc87823a 100644 --- a/src/TNL/Matrices/Legacy/EllpackSymmetricGraph_impl.h +++ b/src/TNL/Matrices/Legacy/EllpackSymmetricGraph_impl.h @@ -16,6 +16,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Device, @@ -73,25 +74,25 @@ void EllpackSymmetricGraph< Real, Device, Index >::setDimensions( const IndexTyp TNL_ASSERT( rows > 0 && columns > 0, std::cerr << "rows = " << rows << " columns = " << columns << std::endl ); - + this->rows = rows; this->columns = columns; - + if( std::is_same< DeviceType, Devices::Cuda >::value ) { this->alignedRows = roundToMultiple( columns, Devices::Cuda::getWarpSize() ); - + if( this->rows - this->alignedRows > 0 ) { IndexType missingRows = this->rows - this->alignedRows; missingRows = roundToMultiple( missingRows, Devices::Cuda::getWarpSize() ); this->alignedRows += missingRows; - + // this->alignedRows += roundToMultiple( this->rows - this->alignedRows, Devices::Cuda::getWarpSize() ); } } else this->alignedRows = rows; - + if( this->rowLengths != 0 ) allocateElements(); } @@ -828,10 +829,10 @@ template< typename Real, void EllpackSymmetricGraph< Real, Device, Index >::allocateElements() { IndexType numberOfMatrixElements = this->alignedRows * this->rowLengths; - - TNL_ASSERT_TRUE( this->alignedRows != 0 && numberOfMatrixElements / this->alignedRows == this->rowLengths, + + TNL_ASSERT_TRUE( this->alignedRows != 0 && numberOfMatrixElements / this->alignedRows == this->rowLengths, "Ellpack cannot store this matrix. The number of matrix elements has overflown the value that IndexType is capable of storing" ); - + Sparse< Real, Device, Index >::allocateMatrixElements( this->alignedRows * this->rowLengths ); } @@ -1038,5 +1039,6 @@ class EllpackSymmetricGraphDeviceDependentCode< Devices::Cuda > } }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/EllpackSymmetric_impl.h b/src/TNL/Matrices/Legacy/EllpackSymmetric_impl.h index f64cef4c5b909428511e006d15d820c5c83d0f27..8bf42b79da148b47b30af6cc446332565489c780 100644 --- a/src/TNL/Matrices/Legacy/EllpackSymmetric_impl.h +++ b/src/TNL/Matrices/Legacy/EllpackSymmetric_impl.h @@ -17,6 +17,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Device, @@ -57,25 +58,25 @@ void EllpackSymmetric< Real, Device, Index >::setDimensions( const IndexType row TNL_ASSERT( rows > 0 && columns > 0, std::cerr << "rows = " << rows << " columns = " << columns <<std::endl ); - + this->rows = rows; this->columns = columns; - + if( std::is_same< DeviceType, Devices::Cuda >::value ) { this->alignedRows = roundToMultiple( columns, Devices::Cuda::getWarpSize() ); - + if( this->rows - this->alignedRows > 0 ) { IndexType missingRows = this->rows - this->alignedRows; missingRows = roundToMultiple( missingRows, Devices::Cuda::getWarpSize() ); this->alignedRows += missingRows; - + // this->alignedRows += roundToMultiple( this->rows - this->alignedRows, Devices::Cuda::getWarpSize() ); } } else this->alignedRows = rows; - + if( this->rowLengths != 0 ) allocateElements(); } @@ -614,10 +615,10 @@ template< typename Real, void EllpackSymmetric< Real, Device, Index >::allocateElements() { IndexType numberOfMatrixElements = this->alignedRows * this->rowLengths; - - TNL_ASSERT_TRUE( this->alignedRows != 0 && numberOfMatrixElements / this->alignedRows == this->rowLengths, + + TNL_ASSERT_TRUE( this->alignedRows != 0 && numberOfMatrixElements / this->alignedRows == this->rowLengths, "Ellpack cannot store this matrix. The number of matrix elements has overflown the value that IndexType is capable of storing" ); - + Sparse< Real, Device, Index >::allocateMatrixElements( this->alignedRows * this->rowLengths ); } @@ -827,5 +828,6 @@ class EllpackSymmetricDeviceDependentCode< Devices::Cuda > } }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/Ellpack_impl.h b/src/TNL/Matrices/Legacy/Ellpack_impl.h index 04ca10385a67cf2782460abef6a4dd797ef95082..2fb582f6039a61ca0fce2dd10d9772a010806c6c 100644 --- a/src/TNL/Matrices/Legacy/Ellpack_impl.h +++ b/src/TNL/Matrices/Legacy/Ellpack_impl.h @@ -17,6 +17,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Device, @@ -966,5 +967,6 @@ class EllpackDeviceDependentCode< Devices::Cuda > } }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/Multidiagonal.h b/src/TNL/Matrices/Legacy/Multidiagonal.h index d9f1379f793f660de1c138609fd085d64909198b..31488a61e0c6a7a9ec107cf7e74c366ba0444159 100644 --- a/src/TNL/Matrices/Legacy/Multidiagonal.h +++ b/src/TNL/Matrices/Legacy/Multidiagonal.h @@ -15,7 +15,8 @@ #include <TNL/Matrices/Legacy/MultidiagonalRow.h> namespace TNL { -namespace Matrices { +namespace Matrices { + namespace Legacy { template< typename Device > class MultidiagonalDeviceDependentCode; @@ -218,6 +219,8 @@ protected: friend class MultidiagonalDeviceDependentCode< DeviceType >; }; + +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter.h b/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter.h index f9e7ef135420f417ab34d6f182dd569d74f30768..b2cbc1d844ce90bf916db243dd7bd5adbf39ec27 100644 --- a/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter.h +++ b/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter.h @@ -14,7 +14,8 @@ #include <TNL/Matrices/Legacy/Multidiagonal.h> namespace TNL { -namespace Matrices { +namespace Matrices { + namespace Legacy { template< typename MeshType > class MultidiagonalMatrixSetter @@ -82,6 +83,7 @@ class MultidiagonalMatrixSetter< Meshes::Grid< 3, MeshReal, Device, MeshIndex > bool crossStencil = false ); }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter_impl.h b/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter_impl.h index 26f6b2994f1f46440f170e42d32689e46807ab77..69adba4a7d1ccf2d0fd39c68acdce1432d5cf81c 100644 --- a/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter_impl.h +++ b/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter_impl.h @@ -11,7 +11,8 @@ #pragma once namespace TNL { -namespace Matrices { +namespace Matrices { + namespace Legacy { template< typename MeshReal, typename Device, @@ -97,5 +98,6 @@ setupMatrix( const MeshType& mesh, return true; } +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/MultidiagonalRow.h b/src/TNL/Matrices/Legacy/MultidiagonalRow.h index c41541eade10ca6b3fa2b98900dffadbc4e62fa9..5b37dfc5604bed3d0d01fdd3b90efd3a14c0f333 100644 --- a/src/TNL/Matrices/Legacy/MultidiagonalRow.h +++ b/src/TNL/Matrices/Legacy/MultidiagonalRow.h @@ -11,7 +11,8 @@ #pragma once namespace TNL { -namespace Matrices { +namespace Matrices { + namespace Legacy { template< typename Real, typename Index > class MultidiagonalRow @@ -51,6 +52,7 @@ class MultidiagonalRow Index row, columns, maxRowLength, step; }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/MultidiagonalRow_impl.h b/src/TNL/Matrices/Legacy/MultidiagonalRow_impl.h index 2765188c1a18fc028e27b455ca3a9986c23409f1..58ecc6207bdd04ee137624a4a585a232adc5b2b3 100644 --- a/src/TNL/Matrices/Legacy/MultidiagonalRow_impl.h +++ b/src/TNL/Matrices/Legacy/MultidiagonalRow_impl.h @@ -11,7 +11,8 @@ #pragma once namespace TNL { -namespace Matrices { +namespace Matrices { + namespace Legacy { template< typename Real, typename Index > __cuda_callable__ @@ -91,5 +92,6 @@ setElement( const Index& elementIndex, this->values[ aux * this->step ] = value; } +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/Multidiagonal_impl.h b/src/TNL/Matrices/Legacy/Multidiagonal_impl.h index 375e01c6d1cfe1439cf419d524bfba51d9b24b0b..87c7e8e410eeb9772281376c46cb3db87c0f989b 100644 --- a/src/TNL/Matrices/Legacy/Multidiagonal_impl.h +++ b/src/TNL/Matrices/Legacy/Multidiagonal_impl.h @@ -16,7 +16,8 @@ #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { -namespace Matrices { +namespace Matrices { + namespace Legacy { template< typename Device > class MultidiagonalDeviceDependentCode; @@ -804,5 +805,6 @@ class MultidiagonalDeviceDependentCode< Devices::Cuda > } }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/SlicedEllpack.h b/src/TNL/Matrices/Legacy/SlicedEllpack.h index 63b4330871820eb534c99b765da000cee10ba263..88ab6ae32fe02a0609d84d58e3f630dbbdf6271d 100644 --- a/src/TNL/Matrices/Legacy/SlicedEllpack.h +++ b/src/TNL/Matrices/Legacy/SlicedEllpack.h @@ -26,6 +26,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Device > class SlicedEllpackDeviceDependentCode; @@ -235,6 +236,7 @@ public: #endif }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/SlicedEllpackSymmetric.h b/src/TNL/Matrices/Legacy/SlicedEllpackSymmetric.h index 835eccf83d43292f75c2e918c7e7ccd3b5d37aaa..99ac3562e94bc30510c70198da4997871f145ff1 100644 --- a/src/TNL/Matrices/Legacy/SlicedEllpackSymmetric.h +++ b/src/TNL/Matrices/Legacy/SlicedEllpackSymmetric.h @@ -15,6 +15,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Device > class SlicedEllpackSymmetricDeviceDependentCode; @@ -202,6 +203,7 @@ class SlicedEllpackSymmetric : public Sparse< Real, Device, Index > }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/SlicedEllpackSymmetricGraph.h b/src/TNL/Matrices/Legacy/SlicedEllpackSymmetricGraph.h index 5fed4082b885093cf7e1a67b1025e73179895471..b7ee87235d3d56091d28f4ed14689867f605a55c 100644 --- a/src/TNL/Matrices/Legacy/SlicedEllpackSymmetricGraph.h +++ b/src/TNL/Matrices/Legacy/SlicedEllpackSymmetricGraph.h @@ -14,7 +14,8 @@ #include <TNL/Containers/Vector.h> namespace TNL { -namespace Matrices { +namespace Matrices { + namespace Legacy { template< typename Device > class SlicedEllpackSymmetricGraphDeviceDependentCode; @@ -233,6 +234,7 @@ class SlicedEllpackSymmetricGraph : public Sparse< Real, Device, Index > }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/SlicedEllpackSymmetricGraph_impl.h b/src/TNL/Matrices/Legacy/SlicedEllpackSymmetricGraph_impl.h index 39cb81c6839efe21c90bcba58aff87ad96a5e447..5ab2f77c1216c98675de1200b9883672f1c0c146 100644 --- a/src/TNL/Matrices/Legacy/SlicedEllpackSymmetricGraph_impl.h +++ b/src/TNL/Matrices/Legacy/SlicedEllpackSymmetricGraph_impl.h @@ -17,6 +17,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Device, @@ -1310,5 +1311,6 @@ class SlicedEllpackSymmetricGraphDeviceDependentCode< Devices::Cuda > }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/SlicedEllpackSymmetric_impl.h b/src/TNL/Matrices/Legacy/SlicedEllpackSymmetric_impl.h index 324cc74bc056efcd489e2ac2ba88ee2113ccea0d..46475ac2007c0b89217eda5f93bfc47c38c45213 100644 --- a/src/TNL/Matrices/Legacy/SlicedEllpackSymmetric_impl.h +++ b/src/TNL/Matrices/Legacy/SlicedEllpackSymmetric_impl.h @@ -17,6 +17,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Device, @@ -37,7 +38,7 @@ String SlicedEllpackSymmetric< Real, Device, Index, SliceSize >::getType() String( ", " ) + String( Device :: getDeviceType() ) + String( ", " ) + - String( TNL::getType< Index >() ) + + String( TNL::getType< Index >() ) + String( " >" ); } @@ -529,8 +530,8 @@ template< typename Real, int SliceSize, typename InVector, typename OutVector > -__global__ -void SlicedEllpackSymmetricVectorProductCudaKernel( +__global__ +void SlicedEllpackSymmetricVectorProductCudaKernel( const SlicedEllpackSymmetric< Real, Devices::Cuda, Index, SliceSize >* matrix, const InVector* inVector, OutVector* outVector, @@ -924,5 +925,6 @@ class SlicedEllpackSymmetricDeviceDependentCode< Devices::Cuda > }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/SlicedEllpack_impl.h b/src/TNL/Matrices/Legacy/SlicedEllpack_impl.h index 8673a02c5085f7ac6b793fcf670ddf9c98c2fd87..fa99206e22fe7f9b09b9c1be83cd60f386c3feb7 100644 --- a/src/TNL/Matrices/Legacy/SlicedEllpack_impl.h +++ b/src/TNL/Matrices/Legacy/SlicedEllpack_impl.h @@ -17,6 +17,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Device, @@ -1051,5 +1052,6 @@ class SlicedEllpackDeviceDependentCode< Devices::Cuda > } }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/Sparse.h b/src/TNL/Matrices/Legacy/Sparse.h index 4de00cb2e8b8197bbe186f891a69fc67e18ba7f0..275c7a9bc79959103df5cc41ff889fe1c8db26eb 100644 --- a/src/TNL/Matrices/Legacy/Sparse.h +++ b/src/TNL/Matrices/Legacy/Sparse.h @@ -15,6 +15,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Device, @@ -61,6 +62,7 @@ class Sparse : public Matrix< Real, Device, Index > Index maxRowLength; }; +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/SparseRow.h b/src/TNL/Matrices/Legacy/SparseRow.h index 4787e638a43f7f2c8f658d75eddd9e5aef9d415f..d0008c93fa03f7e1f0ebaa385e1b981c88f8c3b9 100644 --- a/src/TNL/Matrices/Legacy/SparseRow.h +++ b/src/TNL/Matrices/Legacy/SparseRow.h @@ -18,6 +18,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Index > class SparseRow @@ -77,6 +78,7 @@ std::ostream& operator<<( std::ostream& str, const SparseRow< Real, Index >& row return str; } +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/SparseRow_impl.h b/src/TNL/Matrices/Legacy/SparseRow_impl.h index 84f8e210e28832e838fb73aae560c9fd60a25930..e34f3a8478d20149101553bd45cddd997beda0a1 100644 --- a/src/TNL/Matrices/Legacy/SparseRow_impl.h +++ b/src/TNL/Matrices/Legacy/SparseRow_impl.h @@ -19,6 +19,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Index > __cuda_callable__ @@ -165,5 +166,6 @@ print( std::ostream& str ) const } } +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/Sparse_impl.h b/src/TNL/Matrices/Legacy/Sparse_impl.h index 3e479441229197750dc384e210b0efefb044e1a3..bb8b3449816568fee2b5da820ebcaafae0e5475d 100644 --- a/src/TNL/Matrices/Legacy/Sparse_impl.h +++ b/src/TNL/Matrices/Legacy/Sparse_impl.h @@ -15,6 +15,7 @@ namespace TNL { namespace Matrices { + namespace Legacy { template< typename Real, typename Device, @@ -102,7 +103,7 @@ template< typename Real, void Sparse< Real, Device, Index >::allocateMatrixElements( const IndexType& numberOfMatrixElements ) { TNL_ASSERT_GE( numberOfMatrixElements, 0, "Number of matrix elements must be non-negative." ); - + this->values.setSize( numberOfMatrixElements ); this->columnIndexes.setSize( numberOfMatrixElements ); @@ -122,5 +123,6 @@ void Sparse< Real, Device, Index >::printStructure( std::ostream& str ) const throw Exceptions::NotImplementedError("Sparse::printStructure is not implemented yet."); } +} //namespace Legacy } // namespace Matrices } // namespace TNL diff --git a/src/TNL/Matrices/MatrixInfo.h b/src/TNL/Matrices/MatrixInfo.h index 75cac40557058db2c41b06ca334787e8eb5f356f..73d77f31d691f2c18238beb323ea40e5d3124e49 100644 --- a/src/TNL/Matrices/MatrixInfo.h +++ b/src/TNL/Matrices/MatrixInfo.h @@ -80,7 +80,7 @@ struct MatrixInfo< SparseMatrix< Real, Device, Index, MatrixType, Segments, Real ///// // Legacy matrices template< typename Real, typename Device, typename Index > -struct MatrixInfo< BiEllpack< Real, Device, Index > > +struct MatrixInfo< Legacy::BiEllpack< Real, Device, Index > > { static String getDensity() { return String( "sparse" ); }; @@ -88,7 +88,7 @@ struct MatrixInfo< BiEllpack< Real, Device, Index > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< CSR< Real, Device, Index > > +struct MatrixInfo< Legacy::CSR< Real, Device, Index > > { static String getDensity() { return String( "sparse" ); }; @@ -96,7 +96,7 @@ struct MatrixInfo< CSR< Real, Device, Index > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< ChunkedEllpack< Real, Device, Index > > +struct MatrixInfo< Legacy::ChunkedEllpack< Real, Device, Index > > { static String getDensity() { return String( "sparse" ); }; @@ -104,7 +104,7 @@ struct MatrixInfo< ChunkedEllpack< Real, Device, Index > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Ellpack< Real, Device, Index > > +struct MatrixInfo< Legacy::Ellpack< Real, Device, Index > > { static String getDensity() { return String( "sparse" ); }; @@ -112,7 +112,7 @@ struct MatrixInfo< Ellpack< Real, Device, Index > > }; template< typename Real, typename Device, typename Index, int SliceSize > -struct MatrixInfo< SlicedEllpack< Real, Device, Index, SliceSize> > +struct MatrixInfo< Legacy::SlicedEllpack< Real, Device, Index, SliceSize> > { static String getDensity() { return String( "sparse" ); }; diff --git a/src/TNL/Problems/HeatEquationProblem.h b/src/TNL/Problems/HeatEquationProblem.h index 6a89742270b7f683764184227020351069059bfa..e2d3c4a1a25b6f595f6b5b7ddc1e40459517023e 100644 --- a/src/TNL/Problems/HeatEquationProblem.h +++ b/src/TNL/Problems/HeatEquationProblem.h @@ -50,7 +50,7 @@ class HeatEquationProblem : public PDEProblem< Mesh, typedef Functions::MeshFunction< Mesh > MeshFunctionType; typedef Pointers::SharedPointer< MeshFunctionType, DeviceType > MeshFunctionPointer; typedef PDEProblem< Mesh, Communicator, RealType, DeviceType, IndexType > BaseType; - typedef Matrices::SlicedEllpack< RealType, DeviceType, IndexType > MatrixType; + typedef Matrices::Legacy::SlicedEllpack< RealType, DeviceType, IndexType > MatrixType; typedef Pointers::SharedPointer< DifferentialOperator > DifferentialOperatorPointer; typedef Pointers::SharedPointer< BoundaryCondition > BoundaryConditionPointer; typedef Pointers::SharedPointer< RightHandSide, DeviceType > RightHandSidePointer; diff --git a/src/TNL/Problems/PDEProblem.h b/src/TNL/Problems/PDEProblem.h index c81ffdd396a6caa3b535b942572c65b65749f94c..e73bf633c2b3b6556677776db778f236fe6ae209 100644 --- a/src/TNL/Problems/PDEProblem.h +++ b/src/TNL/Problems/PDEProblem.h @@ -39,7 +39,7 @@ class PDEProblem : public Problem< Real, Device, Index > using SubdomainOverlapsType = typename DistributedMeshType::SubdomainOverlapsType; using DofVectorType = Containers::Vector< RealType, DeviceType, IndexType>; using DofVectorPointer = Pointers::SharedPointer< DofVectorType, DeviceType >; - using MatrixType = Matrices::SlicedEllpack< RealType, DeviceType, IndexType >; + using MatrixType = Matrices::Legacy::SlicedEllpack< RealType, DeviceType, IndexType >; using CommunicatorType = Communicator; using CommonDataType = CommonData; using CommonDataPointer = Pointers::SharedPointer< CommonDataType, DeviceType >; diff --git a/src/TNL/Solvers/Linear/Preconditioners/ILU0.h b/src/TNL/Solvers/Linear/Preconditioners/ILU0.h index 1f2b9f1981c837108be68e0e2864c69537afaf2f..8e9b49cd0a75d079b8e1107c883f47469d488b19 100644 --- a/src/TNL/Solvers/Linear/Preconditioners/ILU0.h +++ b/src/TNL/Solvers/Linear/Preconditioners/ILU0.h @@ -76,7 +76,7 @@ public: protected: // The factors L and U are stored separately and the rows of U are reversed. - Matrices::CSR< RealType, DeviceType, IndexType > L, U; + Matrices::Legacy::CSR< RealType, DeviceType, IndexType > L, U; // Specialized methods to distinguish between normal and distributed matrices // in the implementation. @@ -130,7 +130,7 @@ public: protected: #if defined(HAVE_CUDA) && defined(HAVE_CUSPARSE) - using CSR = Matrices::CSR< RealType, DeviceType, IndexType >; + using CSR = Matrices::Legacy::CSR< RealType, DeviceType, IndexType >; Pointers::UniquePointer< CSR > A, L, U; Containers::Vector< RealType, DeviceType, IndexType > y; diff --git a/src/TNL/Solvers/Linear/Preconditioners/ILUT.h b/src/TNL/Solvers/Linear/Preconditioners/ILUT.h index 6a4a4a83b52fd393bbde144dc5591c7583f4c1e7..99ac7fe521c85dc4daa8b34dc76faa69408aa294 100644 --- a/src/TNL/Solvers/Linear/Preconditioners/ILUT.h +++ b/src/TNL/Solvers/Linear/Preconditioners/ILUT.h @@ -66,7 +66,7 @@ protected: Real tau = 1e-4; // The factors L and U are stored separately and the rows of U are reversed. - Matrices::CSR< RealType, DeviceType, IndexType > L, U; + Matrices::Legacy::CSR< RealType, DeviceType, IndexType > L, U; // Specialized methods to distinguish between normal and distributed matrices // in the implementation. diff --git a/src/TNL/Solvers/SolverConfig_impl.h b/src/TNL/Solvers/SolverConfig_impl.h index 70e7737eee5292617355f7899ecc526d439de2c0..5642995e6b87c081d2cc891ffa9d97c50af707fa 100644 --- a/src/TNL/Solvers/SolverConfig_impl.h +++ b/src/TNL/Solvers/SolverConfig_impl.h @@ -139,7 +139,7 @@ bool SolverConfig< ConfigTag, ProblemConfig >::configSetup( Config::ConfigDescri if( ConfigTagTimeDiscretisation< ConfigTag, SemiImplicitTimeDiscretisationTag >::enabled ) { config.addDelimiter( " === Semi-implicit solvers parameters === " ); - typedef Matrices::CSR< double, Devices::Host, int > MatrixType; + typedef Matrices::Legacy::CSR< double, Devices::Host, int > MatrixType; Linear::CG< MatrixType >::configSetup( config ); Linear::BICGStab< MatrixType >::configSetup( config ); Linear::BICGStabL< MatrixType >::configSetup( config ); diff --git a/src/UnitTests/Matrices/DistributedMatrixTest.h b/src/UnitTests/Matrices/DistributedMatrixTest.h index 9487e59776b4452f42e894ddc856100edde62b9f..ca3f2a100280e16036fca29a717b0ab5db02dfd3 100644 --- a/src/UnitTests/Matrices/DistributedMatrixTest.h +++ b/src/UnitTests/Matrices/DistributedMatrixTest.h @@ -103,12 +103,12 @@ protected: // types for which DistributedMatrixTest is instantiated using DistributedMatrixTypes = ::testing::Types< - Matrices::DistributedMatrix< Matrices::CSR< double, Devices::Host, int >, Communicators::MpiCommunicator >, - Matrices::DistributedMatrix< Matrices::CSR< double, Devices::Host, int >, Communicators::NoDistrCommunicator > + Matrices::DistributedMatrix< Matrices::Legacy::CSR< double, Devices::Host, int >, Communicators::MpiCommunicator >, + Matrices::DistributedMatrix< Matrices::Legacy::CSR< double, Devices::Host, int >, Communicators::NoDistrCommunicator > #ifdef HAVE_CUDA , - Matrices::DistributedMatrix< Matrices::CSR< double, Devices::Cuda, int >, Communicators::MpiCommunicator >, - Matrices::DistributedMatrix< Matrices::CSR< double, Devices::Cuda, int >, Communicators::NoDistrCommunicator > + Matrices::DistributedMatrix< Matrices::Legacy::CSR< double, Devices::Cuda, int >, Communicators::MpiCommunicator >, + Matrices::DistributedMatrix< Matrices::Legacy::CSR< double, Devices::Cuda, int >, Communicators::NoDistrCommunicator > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/SparseMatrixTest.h b/src/UnitTests/Matrices/Legacy/SparseMatrixTest.h index ed8bec79603b41e291246428cb59b9a040a56744..f7ee41411f33826c0b4fd01d82d17267bf75bd11 100644 --- a/src/UnitTests/Matrices/Legacy/SparseMatrixTest.h +++ b/src/UnitTests/Matrices/Legacy/SparseMatrixTest.h @@ -16,11 +16,11 @@ #ifdef HAVE_GTEST #include <gtest/gtest.h> -using CSR_host_float = TNL::Matrices::CSR< float, TNL::Devices::Host, int >; -using CSR_host_int = TNL::Matrices::CSR< int, TNL::Devices::Host, int >; +using CSR_host_float = TNL::Matrices::Legacy::CSR< float, TNL::Devices::Host, int >; +using CSR_host_int = TNL::Matrices::Legacy::CSR< int, TNL::Devices::Host, int >; -using CSR_cuda_float = TNL::Matrices::CSR< float, TNL::Devices::Cuda, int >; -using CSR_cuda_int = TNL::Matrices::CSR< int, TNL::Devices::Cuda, int >; +using CSR_cuda_float = TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, int >; +using CSR_cuda_int = TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, int >; TEST( SparseMatrixTest, CSR_perforSORIterationTest_Host ) { diff --git a/src/UnitTests/Matrices/Legacy/SparseMatrixTest.hpp b/src/UnitTests/Matrices/Legacy/SparseMatrixTest.hpp index c6ff5cbd7349ed52e65d794b3a4df0c7915ba8e6..2e6c382967ae340d95119ed32782ff78a8062464 100644 --- a/src/UnitTests/Matrices/Legacy/SparseMatrixTest.hpp +++ b/src/UnitTests/Matrices/Legacy/SparseMatrixTest.hpp @@ -1417,8 +1417,8 @@ void test_OperatorEquals() return; else { - using AdELL_host = TNL::Matrices::AdEllpack< RealType, TNL::Devices::Host, IndexType >; - using AdELL_cuda = TNL::Matrices::AdEllpack< RealType, TNL::Devices::Cuda, IndexType >; + using AdELL_host = TNL::Matrices::Legacy::AdEllpack< RealType, TNL::Devices::Host, IndexType >; + using AdELL_cuda = TNL::Matrices::Legacy::AdEllpack< RealType, TNL::Devices::Cuda, IndexType >; /* * Sets up the following 8x8 sparse matrix: diff --git a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_AdEllpack.h b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_AdEllpack.h index 8e07205e5e9c012a05e75923c8065c4aabf1717e..ca2b0b9724907b5576699e7b6f4598c825b52099 100644 --- a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_AdEllpack.h +++ b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_AdEllpack.h @@ -27,23 +27,23 @@ protected: // types for which MatrixTest is instantiated using AdEllpackMatrixTypes = ::testing::Types < - TNL::Matrices::AdEllpack< int, TNL::Devices::Host, int >, - TNL::Matrices::AdEllpack< long, TNL::Devices::Host, int >, - TNL::Matrices::AdEllpack< float, TNL::Devices::Host, int >, - TNL::Matrices::AdEllpack< double, TNL::Devices::Host, int >, - TNL::Matrices::AdEllpack< int, TNL::Devices::Host, long >, - TNL::Matrices::AdEllpack< long, TNL::Devices::Host, long >, - TNL::Matrices::AdEllpack< float, TNL::Devices::Host, long >, - TNL::Matrices::AdEllpack< double, TNL::Devices::Host, long > + TNL::Matrices::Legacy::AdEllpack< int, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::AdEllpack< long, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::AdEllpack< float, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::AdEllpack< double, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::AdEllpack< int, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::AdEllpack< long, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::AdEllpack< float, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::AdEllpack< double, TNL::Devices::Host, long > #ifdef HAVE_CUDA - ,TNL::Matrices::AdEllpack< int, TNL::Devices::Cuda, int >, - TNL::Matrices::AdEllpack< long, TNL::Devices::Cuda, int >, - TNL::Matrices::AdEllpack< float, TNL::Devices::Cuda, int >, - TNL::Matrices::AdEllpack< double, TNL::Devices::Cuda, int >, - TNL::Matrices::AdEllpack< int, TNL::Devices::Cuda, long >, - TNL::Matrices::AdEllpack< long, TNL::Devices::Cuda, long >, - TNL::Matrices::AdEllpack< float, TNL::Devices::Cuda, long >, - TNL::Matrices::AdEllpack< double, TNL::Devices::Cuda, long > + ,TNL::Matrices::Legacy::AdEllpack< int, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::AdEllpack< long, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::AdEllpack< float, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::AdEllpack< double, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::AdEllpack< int, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::AdEllpack< long, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::AdEllpack< float, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::AdEllpack< double, TNL::Devices::Cuda, long > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_BiEllpack.h b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_BiEllpack.h index c386481071f7ce2e4a209d3457f47a060e8dae98..cdac8af6e357ad0672eb17d554acb9d2c0de7bb2 100644 --- a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_BiEllpack.h +++ b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_BiEllpack.h @@ -27,23 +27,23 @@ protected: // types for which MatrixTest is instantiated using BiEllpackMatrixTypes = ::testing::Types < - TNL::Matrices::BiEllpack< int, TNL::Devices::Host, int >, - TNL::Matrices::BiEllpack< long, TNL::Devices::Host, int >, - TNL::Matrices::BiEllpack< float, TNL::Devices::Host, int >, - TNL::Matrices::BiEllpack< double, TNL::Devices::Host, int >, - TNL::Matrices::BiEllpack< int, TNL::Devices::Host, long >, - TNL::Matrices::BiEllpack< long, TNL::Devices::Host, long >, - TNL::Matrices::BiEllpack< float, TNL::Devices::Host, long >, - TNL::Matrices::BiEllpack< double, TNL::Devices::Host, long > + TNL::Matrices::Legacy::BiEllpack< int, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::BiEllpack< long, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::BiEllpack< float, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::BiEllpack< double, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::BiEllpack< int, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::BiEllpack< long, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::BiEllpack< float, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::BiEllpack< double, TNL::Devices::Host, long > #ifdef HAVE_CUDA - ,TNL::Matrices::BiEllpack< int, TNL::Devices::Cuda, int >, - TNL::Matrices::BiEllpack< long, TNL::Devices::Cuda, int >, - TNL::Matrices::BiEllpack< float, TNL::Devices::Cuda, int >, - TNL::Matrices::BiEllpack< double, TNL::Devices::Cuda, int >, - TNL::Matrices::BiEllpack< int, TNL::Devices::Cuda, long >, - TNL::Matrices::BiEllpack< long, TNL::Devices::Cuda, long >, - TNL::Matrices::BiEllpack< float, TNL::Devices::Cuda, long >, - TNL::Matrices::BiEllpack< double, TNL::Devices::Cuda, long > + ,TNL::Matrices::Legacy::BiEllpack< int, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::BiEllpack< long, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::BiEllpack< float, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::BiEllpack< double, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::BiEllpack< int, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::BiEllpack< long, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::BiEllpack< float, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::BiEllpack< double, TNL::Devices::Cuda, long > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_CSR.h b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_CSR.h index 13c1ed6e00c872623c66fc88d8e57cb94ffb7557..bbe336d1fd540a7bd122f0e74073638d31a70503 100644 --- a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_CSR.h +++ b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_CSR.h @@ -27,23 +27,23 @@ protected: // types for which MatrixTest is instantiated using CSRMatrixTypes = ::testing::Types < - TNL::Matrices::CSR< int, TNL::Devices::Host, int >, - TNL::Matrices::CSR< long, TNL::Devices::Host, int >, - TNL::Matrices::CSR< float, TNL::Devices::Host, int >, - TNL::Matrices::CSR< double, TNL::Devices::Host, int >, - TNL::Matrices::CSR< int, TNL::Devices::Host, long >, - TNL::Matrices::CSR< long, TNL::Devices::Host, long >, - TNL::Matrices::CSR< float, TNL::Devices::Host, long >, - TNL::Matrices::CSR< double, TNL::Devices::Host, long > + TNL::Matrices::Legacy::CSR< int, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::CSR< long, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::CSR< float, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::CSR< double, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::CSR< int, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::CSR< long, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::CSR< float, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::CSR< double, TNL::Devices::Host, long > #ifdef HAVE_CUDA - ,TNL::Matrices::CSR< int, TNL::Devices::Cuda, int >, - TNL::Matrices::CSR< long, TNL::Devices::Cuda, int >, - TNL::Matrices::CSR< float, TNL::Devices::Cuda, int >, - TNL::Matrices::CSR< double, TNL::Devices::Cuda, int >, - TNL::Matrices::CSR< int, TNL::Devices::Cuda, long >, - TNL::Matrices::CSR< long, TNL::Devices::Cuda, long >, - TNL::Matrices::CSR< float, TNL::Devices::Cuda, long >, - TNL::Matrices::CSR< double, TNL::Devices::Cuda, long > + ,TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::CSR< long, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::CSR< long, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, long > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_ChunkedEllpack.h b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_ChunkedEllpack.h index 5d304bde3fff44ffdaf3ccbd812412faa2738824..d633abdbf3d6e2c1bd9bf57d0596e21810befe97 100644 --- a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_ChunkedEllpack.h +++ b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_ChunkedEllpack.h @@ -28,23 +28,23 @@ protected: // types for which MatrixTest is instantiated using ChEllpackMatrixTypes = ::testing::Types < - TNL::Matrices::ChunkedEllpack< int, TNL::Devices::Host, int >, - TNL::Matrices::ChunkedEllpack< long, TNL::Devices::Host, int >, - TNL::Matrices::ChunkedEllpack< float, TNL::Devices::Host, int >, - TNL::Matrices::ChunkedEllpack< double, TNL::Devices::Host, int >, - TNL::Matrices::ChunkedEllpack< int, TNL::Devices::Host, long >, - TNL::Matrices::ChunkedEllpack< long, TNL::Devices::Host, long >, - TNL::Matrices::ChunkedEllpack< float, TNL::Devices::Host, long >, - TNL::Matrices::ChunkedEllpack< double, TNL::Devices::Host, long > + TNL::Matrices::Legacy::ChunkedEllpack< int, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::ChunkedEllpack< long, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::ChunkedEllpack< float, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::ChunkedEllpack< double, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::ChunkedEllpack< int, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::ChunkedEllpack< long, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::ChunkedEllpack< float, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::ChunkedEllpack< double, TNL::Devices::Host, long > #ifdef HAVE_CUDA - ,TNL::Matrices::ChunkedEllpack< int, TNL::Devices::Cuda, int >, - TNL::Matrices::ChunkedEllpack< long, TNL::Devices::Cuda, int >, - TNL::Matrices::ChunkedEllpack< float, TNL::Devices::Cuda, int >, - TNL::Matrices::ChunkedEllpack< double, TNL::Devices::Cuda, int >, - TNL::Matrices::ChunkedEllpack< int, TNL::Devices::Cuda, long >, - TNL::Matrices::ChunkedEllpack< long, TNL::Devices::Cuda, long >, - TNL::Matrices::ChunkedEllpack< float, TNL::Devices::Cuda, long >, - TNL::Matrices::ChunkedEllpack< double, TNL::Devices::Cuda, long > + ,TNL::Matrices::Legacy::ChunkedEllpack< int, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::ChunkedEllpack< long, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::ChunkedEllpack< float, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::ChunkedEllpack< double, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::ChunkedEllpack< int, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::ChunkedEllpack< long, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::ChunkedEllpack< float, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::ChunkedEllpack< double, TNL::Devices::Cuda, long > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_Ellpack.h b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_Ellpack.h index bb9fe4fc76e49a408a6a370ab5b1b9b9c1e56660..dd86d63167de179e198ad958c37a5114e5e2ce52 100644 --- a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_Ellpack.h +++ b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_Ellpack.h @@ -27,23 +27,23 @@ protected: // types for which MatrixTest is instantiated using EllpackMatrixTypes = ::testing::Types < - TNL::Matrices::Ellpack< int, TNL::Devices::Host, int >, - TNL::Matrices::Ellpack< long, TNL::Devices::Host, int >, - TNL::Matrices::Ellpack< float, TNL::Devices::Host, int >, - TNL::Matrices::Ellpack< double, TNL::Devices::Host, int >, - TNL::Matrices::Ellpack< int, TNL::Devices::Host, long >, - TNL::Matrices::Ellpack< long, TNL::Devices::Host, long >, - TNL::Matrices::Ellpack< float, TNL::Devices::Host, long >, - TNL::Matrices::Ellpack< double, TNL::Devices::Host, long > + TNL::Matrices::Legacy::Ellpack< int, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::Ellpack< long, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::Ellpack< float, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::Ellpack< double, TNL::Devices::Host, int >, + TNL::Matrices::Legacy::Ellpack< int, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::Ellpack< long, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::Ellpack< float, TNL::Devices::Host, long >, + TNL::Matrices::Legacy::Ellpack< double, TNL::Devices::Host, long > #ifdef HAVE_CUDA - ,TNL::Matrices::Ellpack< int, TNL::Devices::Cuda, int >, - TNL::Matrices::Ellpack< long, TNL::Devices::Cuda, int >, - TNL::Matrices::Ellpack< float, TNL::Devices::Cuda, int >, - TNL::Matrices::Ellpack< double, TNL::Devices::Cuda, int >, - TNL::Matrices::Ellpack< int, TNL::Devices::Cuda, long >, - TNL::Matrices::Ellpack< long, TNL::Devices::Cuda, long >, - TNL::Matrices::Ellpack< float, TNL::Devices::Cuda, long >, - TNL::Matrices::Ellpack< double, TNL::Devices::Cuda, long > + ,TNL::Matrices::Legacy::Ellpack< int, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::Ellpack< long, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::Ellpack< float, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::Ellpack< double, TNL::Devices::Cuda, int >, + TNL::Matrices::Legacy::Ellpack< int, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::Ellpack< long, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::Ellpack< float, TNL::Devices::Cuda, long >, + TNL::Matrices::Legacy::Ellpack< double, TNL::Devices::Cuda, long > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_SlicedEllpack.h b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_SlicedEllpack.h index 8b39583847d765ad2ede230a00eea74caec119f7..168f482eae4b56488fea3abe0beca9c4cf1cbbc4 100644 --- a/src/UnitTests/Matrices/Legacy/SparseMatrixTest_SlicedEllpack.h +++ b/src/UnitTests/Matrices/Legacy/SparseMatrixTest_SlicedEllpack.h @@ -26,7 +26,7 @@ protected: }; template< typename Real, typename Device, typename Index > -using SlicedEllpackType = TNL::Matrices::SlicedEllpack< Real, Device, Index, 32 >; +using SlicedEllpackType = TNL::Matrices::Legacy::SlicedEllpack< Real, Device, Index, 32 >; // types for which MatrixTest is instantiated