diff --git a/src/Benchmarks/BLAS/spmv.h b/src/Benchmarks/BLAS/spmv.h index 85cb4b7314d87eed342daf4a2e0196f0c7a752d1..587794f356c210e4469e4c1b6ca190c4a3c50b8a 100644 --- a/src/Benchmarks/BLAS/spmv.h +++ b/src/Benchmarks/BLAS/spmv.h @@ -15,7 +15,7 @@ #include "../Benchmarks.h" #include <TNL/Pointers/DevicePointer.h> -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack.h> @@ -25,11 +25,11 @@ namespace Benchmarks { // silly alias to match the number of template parameters with other formats template< typename Real, typename Device, typename Index > -using SlicedEllpack = Matrices::Legacy::SlicedEllpack< Real, Device, Index >; +using SlicedEllpack = SpMV::ReferenceFormats::Legacy::SlicedEllpack< Real, Device, Index >; // Legacy formats template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Scalar = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRScalar >; +using SparseMatrixLegacy_CSR_Scalar = SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, SpMV::ReferenceFormats::Legacy::CSRScalar >; template< typename Matrix > @@ -180,9 +180,9 @@ benchmarkSpmvSynthetic( Benchmark & benchmark, // TODO: benchmark all formats from tnl-benchmark-spmv (different parameters of the base formats) // NOTE: CSR is disabled because it is very slow on GPU //benchmarkSpMV< Real, SparseMatrixLegacy_CSR_Scalar >( benchmark, size, elementsPerRow ); - benchmarkSpMV< Real, Matrices::Legacy::Ellpack >( benchmark, size, elementsPerRow ); + benchmarkSpMV< Real, Benchmarks::SpMV::ReferenceFormats::Legacy::Ellpack >( benchmark, size, elementsPerRow ); benchmarkSpMV< Real, SlicedEllpack >( benchmark, size, elementsPerRow ); - benchmarkSpMV< Real, Matrices::Legacy::ChunkedEllpack >( benchmark, size, elementsPerRow ); + benchmarkSpMV< Real, Benchmarks::SpMV::ReferenceFormats::Legacy::ChunkedEllpack >( benchmark, size, elementsPerRow ); } } // namespace Benchmarks diff --git a/src/TNL/Matrices/Legacy/AdEllpack.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack.h similarity index 96% rename from src/TNL/Matrices/Legacy/AdEllpack.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack.h index 4c6a0236665c9ca2263dac814470dd054de561f3..7ef968cddad9df39d3973881edab49c241d98e3a 100644 --- a/src/TNL/Matrices/Legacy/AdEllpack.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack.h @@ -22,8 +22,10 @@ #include <TNL/Containers/Vector.h> namespace TNL { -namespace Matrices { -namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Device > class AdEllpackDeviceDependentCode; @@ -296,8 +298,10 @@ protected: }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL -#include <TNL/Matrices/Legacy/AdEllpack_impl.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack_impl.h> diff --git a/src/TNL/Matrices/Legacy/AdEllpack_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack_impl.h similarity index 99% rename from src/TNL/Matrices/Legacy/AdEllpack_impl.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack_impl.h index 3d3af0db10b835dedbd05acf678262c1478801dd..42d3e3a6e0fddae805c64234fbeaf4f441511706 100644 --- a/src/TNL/Matrices/Legacy/AdEllpack_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack_impl.h @@ -8,7 +8,7 @@ /* See Copyright Notice in tnl/Copyright */ -#include <TNL/Matrices/Legacy/AdEllpack.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack.h> #include <TNL/Containers/Vector.h> #include <TNL/Math.h> #include <TNL/TypeInfo.h> @@ -16,8 +16,10 @@ #pragma once namespace TNL { -namespace Matrices { -namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { /* * Auxiliary list implementation @@ -1587,6 +1589,8 @@ public: }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack.h index 5f6e2728d4a3aa1a23ef9875564d567205b5a86b..cdb2c97e4efca99e43bd8bcf6ac99acdbd33d4da 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack.h @@ -22,8 +22,10 @@ #include <TNL/Containers/Vector.h> namespace TNL { - namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Device > @@ -219,8 +221,10 @@ private: Containers::Vector< Index, Device, Index > groupPointers; }; - } //namespace Legacy - } //namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL #include <Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack_impl.h> diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack_impl.h index 5c0ee8b2c8d22236217d003360c63db215eaad5c..d33ee47cc778187237378da3ddb3ccda99271511 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack_impl.h @@ -17,8 +17,10 @@ #include <cstdio> namespace TNL { - namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, @@ -1510,7 +1512,9 @@ public: } }; - } //namespace Legacy - } //namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/CSR.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h similarity index 97% rename from src/TNL/Matrices/Legacy/CSR.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h index c7a7af32164dabeb3dfbca4537e3dfbd63999ac5..487ed18bf5693fc709dfb93a655a2a53378c2658 100644 --- a/src/TNL/Matrices/Legacy/CSR.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h @@ -17,8 +17,10 @@ #include <TNL/Exceptions/CudaBadAlloc.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { enum class Type { /* LONG = 0!!! Non zero value rewrites index[1] */ @@ -332,8 +334,10 @@ protected: friend class CusparseCSR< RealType >; }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL -#include <TNL/Matrices/Legacy/CSR_impl.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR_impl.h> diff --git a/src/TNL/Matrices/Legacy/CSR_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/CSR_impl.h similarity index 99% rename from src/TNL/Matrices/Legacy/CSR_impl.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/CSR_impl.h index e23a20f0c219ac5b80923b0bad9c6d1f25c85d29..4aa61a09f003985fc39a060644c047be96d39844 100644 --- a/src/TNL/Matrices/Legacy/CSR_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/CSR_impl.h @@ -10,7 +10,7 @@ #pragma once -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include <TNL/Containers/VectorView.h> #include <TNL/Math.h> #include <TNL/Algorithms/AtomicOperations.h> @@ -26,8 +26,10 @@ constexpr size_t MAX_X_DIM = 2147483647; namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { #ifdef HAVE_CUSPARSE template< typename Real, typename Index > @@ -1764,7 +1766,7 @@ void SpMVCSRAdaptivePrepare( const Real *inVector, SpMVCSRAdaptive< Real, Index, warpSize, matrix.WARPS, - matrix.SHARED_PER_WARP, + matrix.SHARED_PER_WARP, matrix.MAX_ELEMENTS_PER_WARP_ADAPT > <<<blocks, threads>>>( inVector, @@ -1972,6 +1974,8 @@ class CSRDeviceDependentCode< Devices::Cuda > } }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack.h index 3cd9a58ae50ab7d4a3f66b2ab3deaf38b26933a6..0c310319ed01397909bd8c5a61d34bb5103fef46 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack.h @@ -26,8 +26,10 @@ #include <TNL/Containers/Vector.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Device > class ChunkedEllpackDeviceDependentCode; @@ -353,8 +355,10 @@ protected: #endif }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL #include <Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack_impl.h> diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack_impl.h index 7cc04ad8b24aaa0acfccb9c8cce436ac1726cfad..df662277706d326f27afc60c2467752e91d0d817 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack_impl.h @@ -16,8 +16,10 @@ #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, typename Index, @@ -1509,6 +1511,8 @@ class ChunkedEllpackDeviceDependentCode< Devices::Cuda > }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h index ad812b6115d64b5b5a57cac0941f8a4d8a3e3415..5aee8c78952f4466ee3226a4bcd1a5bfd276f986 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h @@ -14,8 +14,10 @@ #include <TNL/Containers/Vector.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Device > class EllpackDeviceDependentCode; @@ -210,8 +212,10 @@ protected: friend class EllpackDeviceDependentCode< DeviceType >; }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL #include <Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack_impl.h> diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack_impl.h index f2e37c39ca37be299e79591a6f7cba82f42e02be..6f7845862a70684762ea3c487ca7482e95e7b498 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack_impl.h @@ -16,8 +16,10 @@ #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, typename Device, @@ -975,6 +977,8 @@ class EllpackDeviceDependentCode< Devices::Cuda > } }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/Multidiagonal.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Multidiagonal.h similarity index 94% rename from src/TNL/Matrices/Legacy/Multidiagonal.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/Multidiagonal.h index 129a9f59a5006b664b3f881a33d77a01d204a3ec..8153854cca0bfc9342dae32f564c986cb49c6a32 100644 --- a/src/TNL/Matrices/Legacy/Multidiagonal.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Multidiagonal.h @@ -12,11 +12,13 @@ #include <TNL/Matrices/Matrix.h> #include <TNL/Containers/Vector.h> -#include <TNL/Matrices/Legacy/MultidiagonalRow.h> +#include <TNL/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalRow.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Device > class MultidiagonalDeviceDependentCode; @@ -223,8 +225,10 @@ protected: }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL -#include <TNL/Matrices/Legacy/Multidiagonal_impl.h> +#include <TNL/Benchmarks/SpMV/ReferenceFormats/Legacy/Multidiagonal_impl.h> diff --git a/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalMatrixSetter.h similarity index 87% rename from src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalMatrixSetter.h index b2cbc1d844ce90bf916db243dd7bd5adbf39ec27..bbd13c2d32d4870930d610a245f553888cf425e8 100644 --- a/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalMatrixSetter.h @@ -11,11 +11,13 @@ #pragma once #include <TNL/Meshes/Grid.h> -#include <TNL/Matrices/Legacy/Multidiagonal.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/Multidiagonal.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename MeshType > class MultidiagonalMatrixSetter @@ -83,8 +85,10 @@ class MultidiagonalMatrixSetter< Meshes::Grid< 3, MeshReal, Device, MeshIndex > bool crossStencil = false ); }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL -#include <TNL/Matrices/Legacy/MultidiagonalMatrixSetter_impl.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalMatrixSetter_impl.h> diff --git a/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalMatrixSetter_impl.h similarity index 94% rename from src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter_impl.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalMatrixSetter_impl.h index 69adba4a7d1ccf2d0fd39c68acdce1432d5cf81c..cde61d71534115474256341ca02af5baf7d2d8f6 100644 --- a/src/TNL/Matrices/Legacy/MultidiagonalMatrixSetter_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalMatrixSetter_impl.h @@ -11,8 +11,10 @@ #pragma once namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename MeshReal, typename Device, @@ -98,6 +100,8 @@ setupMatrix( const MeshType& mesh, return true; } -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/MultidiagonalRow.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalRow.h similarity index 81% rename from src/TNL/Matrices/Legacy/MultidiagonalRow.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalRow.h index 5b37dfc5604bed3d0d01fdd3b90efd3a14c0f333..2b078bde932fa1a0d2c196ae274db41d59fc5e4b 100644 --- a/src/TNL/Matrices/Legacy/MultidiagonalRow.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalRow.h @@ -11,8 +11,10 @@ #pragma once namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, typename Index > class MultidiagonalRow @@ -52,9 +54,11 @@ class MultidiagonalRow Index row, columns, maxRowLength, step; }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL -#include <TNL/Matrices/Legacy/MultidiagonalRow_impl.h> +#include <TNL/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalRow_impl.h> diff --git a/src/TNL/Matrices/Legacy/MultidiagonalRow_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalRow_impl.h similarity index 91% rename from src/TNL/Matrices/Legacy/MultidiagonalRow_impl.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalRow_impl.h index 58ecc6207bdd04ee137624a4a585a232adc5b2b3..7942032c7971c6159b0149885d6472214f909b95 100644 --- a/src/TNL/Matrices/Legacy/MultidiagonalRow_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/MultidiagonalRow_impl.h @@ -11,8 +11,10 @@ #pragma once namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, typename Index > __cuda_callable__ @@ -92,6 +94,8 @@ setElement( const Index& elementIndex, this->values[ aux * this->step ] = value; } -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/TNL/Matrices/Legacy/Multidiagonal_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Multidiagonal_impl.h similarity index 98% rename from src/TNL/Matrices/Legacy/Multidiagonal_impl.h rename to src/Benchmarks/SpMV/ReferenceFormats/Legacy/Multidiagonal_impl.h index d3a7599054b8e5365cc568fefcd372373ebb2944..f976f1981d0acb0e126af8f1d9ef7346a82ae321 100644 --- a/src/TNL/Matrices/Legacy/Multidiagonal_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Multidiagonal_impl.h @@ -10,14 +10,16 @@ #pragma once -#include <TNL/Matrices/Legacy/Multidiagonal.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/Multidiagonal.h> #include <TNL/Containers/Vector.h> #include <TNL/Math.h> #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Device > class MultidiagonalDeviceDependentCode; @@ -813,6 +815,8 @@ class MultidiagonalDeviceDependentCode< Devices::Cuda > } }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h index 0254c5e4b9de41229cfb48a5c3b27b4da3e9e7ea..e41949129bd239cae573b3e19ee74f0fec210574 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h @@ -25,8 +25,10 @@ #include <TNL/Containers/Vector.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Device > class SlicedEllpackDeviceDependentCode; @@ -238,8 +240,10 @@ public: #endif }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL #include <Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack_impl.h> diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack_impl.h index 3a28a4a6e35913ccc161999e2a557cc600e16626..c7127cf1fd0e95e979ad1ca8619c9d836bae81a0 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack_impl.h @@ -16,8 +16,10 @@ #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, typename Device, @@ -1061,6 +1063,8 @@ class SlicedEllpackDeviceDependentCode< Devices::Cuda > } }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Sparse.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Sparse.h index 5f75efe1849889ab7a9189961241ebdfd1c9f6e4..2e50843c2e2b3e28fc6ceee2fb36d3ec81b7daa1 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Sparse.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Sparse.h @@ -14,22 +14,24 @@ #include <Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, typename Device, typename Index > -class Sparse : public Matrix< Real, Device, Index > +class Sparse : public TNL::Matrices::Matrix< Real, Device, Index > { public: typedef Real RealType; typedef Device DeviceType; typedef Index IndexType; - typedef typename Matrix< RealType, DeviceType, IndexType >::ValuesVectorType ValuesVector; + typedef typename TNL::Matrices::Matrix< RealType, DeviceType, IndexType >::ValuesVectorType ValuesVector; typedef Containers::Vector< IndexType, DeviceType, IndexType > ColumnIndexesVector; - typedef Matrix< Real, Device, Index > BaseType; + typedef TNL::Matrices::Matrix< Real, Device, Index > BaseType; typedef SparseRow< RealType, IndexType > MatrixRow; typedef SparseRow< const RealType, const IndexType > ConstMatrixRow; @@ -62,8 +64,10 @@ class Sparse : public Matrix< Real, Device, Index > Index maxRowLength; }; -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL #include <Benchmarks/SpMV/ReferenceFormats/Legacy/Sparse_impl.h> diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow.h index 0b5ff29d9925fdc288ac72a54deebe5d8d72fa46..c0f578b089cfc758e0946e03c296763c41bb3f25 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow.h @@ -17,8 +17,10 @@ #include <TNL/Cuda/CudaCallable.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, typename Index > class SparseRow @@ -96,8 +98,10 @@ std::ostream& operator<<( std::ostream& str, const SparseRow< Real, Index >& row return str; } -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL #include <Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow_impl.h> diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow_impl.h index f538bbb86285fb210c931e7475817dcd447189e6..fa486fa91f29ca17a51b899c22ad7c25c529e038 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/SparseRow_impl.h @@ -18,8 +18,10 @@ #include <vector> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, typename Index > __cuda_callable__ @@ -166,6 +168,8 @@ print( std::ostream& str ) const } } -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Sparse_impl.h b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Sparse_impl.h index bb8b3449816568fee2b5da820ebcaafae0e5475d..d87c80eee51b8115c6b5fb5e80a899ac72f7b22c 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Sparse_impl.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/Legacy/Sparse_impl.h @@ -14,8 +14,10 @@ #include <TNL/Exceptions/NotImplementedError.h> namespace TNL { -namespace Matrices { - namespace Legacy { + namespace Benchmarks { + namespace SpMV { + namespace ReferenceFormats { + namespace Legacy { template< typename Real, typename Device, @@ -33,7 +35,7 @@ template< typename Real, typename Index2 > void Sparse< Real, Device, Index >::setLike( const Sparse< Real2, Device2, Index2 >& matrix ) { - Matrix< Real, Device, Index >::setLike( matrix ); + TNL::Matrices::Matrix< Real, Device, Index >::setLike( matrix ); this->allocateMatrixElements( matrix.getAllocatedElementsCount() ); } @@ -75,7 +77,7 @@ template< typename Real, typename Index > void Sparse< Real, Device, Index >::reset() { - Matrix< Real, Device, Index >::reset(); + TNL::Matrices::Matrix< Real, Device, Index >::reset(); this->columnIndexes.reset(); } @@ -84,7 +86,7 @@ template< typename Real, typename Index > void Sparse< Real, Device, Index >::save( File& file ) const { - Matrix< Real, Device, Index >::save( file ); + TNL::Matrices::Matrix< Real, Device, Index >::save( file ); file << this->values << this->columnIndexes; } @@ -93,7 +95,7 @@ template< typename Real, typename Index > void Sparse< Real, Device, Index >::load( File& file ) { - Matrix< Real, Device, Index >::load( file ); + TNL::Matrices::Matrix< Real, Device, Index >::load( file ); file >> this->values >> this->columnIndexes; } @@ -123,6 +125,8 @@ void Sparse< Real, Device, Index >::printStructure( std::ostream& str ) const throw Exceptions::NotImplementedError("Sparse::printStructure is not implemented yet."); } -} //namespace Legacy -} // namespace Matrices + } //namespace Legacy + } //namespace ReferenceFormats + } //namespace SpMV + } //namespace Benchmarks } // namespace TNL diff --git a/src/Benchmarks/SpMV/ReferenceFormats/cusparseCSRMatrix.h b/src/Benchmarks/SpMV/ReferenceFormats/cusparseCSRMatrix.h index ea5b9ddbfa68effa62bb9fc3108b6d993ca1f532..b331ac7ad17ce7a6b25b1662c8094d7b814a1500 100644 --- a/src/Benchmarks/SpMV/ReferenceFormats/cusparseCSRMatrix.h +++ b/src/Benchmarks/SpMV/ReferenceFormats/cusparseCSRMatrix.h @@ -22,7 +22,7 @@ class CusparseCSRBase public: typedef Real RealType; typedef Devices::Cuda DeviceType; - typedef Matrices::Legacy::CSR< RealType, Devices::Cuda, int > MatrixType; + typedef Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< RealType, Devices::Cuda, int > MatrixType; CusparseCSRBase() : matrix( 0 ) diff --git a/src/Benchmarks/SpMV/spmv-legacy.h b/src/Benchmarks/SpMV/spmv-legacy.h index fed37410cf4e004deec7b5a7a8ac6cb2b04ee1d7..f7fbf9240479626e96caddf7064113610332a30b 100644 --- a/src/Benchmarks/SpMV/spmv-legacy.h +++ b/src/Benchmarks/SpMV/spmv-legacy.h @@ -18,11 +18,11 @@ #include "SpmvBenchmarkResult.h" #include <TNL/Pointers/DevicePointer.h> -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack.h> -#include <TNL/Matrices/Legacy/AdEllpack.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack.h> #include <TNL/Matrices/MatrixReader.h> @@ -45,7 +45,7 @@ namespace TNL { // Alias to match the number of template parameters with other formats template< typename Real, typename Device, typename Index > -using SlicedEllpackAlias = Matrices::Legacy::SlicedEllpack< Real, Device, Index >; +using SlicedEllpackAlias = Benchmarks::SpMV::ReferenceFormats::Legacy::SlicedEllpack< Real, Device, Index >; // Segments based sparse matrix aliases template< typename Real, typename Device, typename Index > @@ -86,37 +86,37 @@ using SparseMatrix_BiEllpack = Matrices::SparseMatrix< Real, Device, Index, Matr // Legacy formats template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Scalar = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRScalar >; +using SparseMatrixLegacy_CSR_Scalar = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRScalar >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Vector = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRVector >; +using SparseMatrixLegacy_CSR_Vector = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRVector >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Light = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRLight >; +using SparseMatrixLegacy_CSR_Light = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Light2 = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRLight2 >; +using SparseMatrixLegacy_CSR_Light2 = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight2 >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Light3 = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRLight3 >; +using SparseMatrixLegacy_CSR_Light3 = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight3 >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Light4 = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRLight4 >; +using SparseMatrixLegacy_CSR_Light4 = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight4 >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Light5 = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRLight5 >; +using SparseMatrixLegacy_CSR_Light5 = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight5 >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Light6 = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRLight6 >; +using SparseMatrixLegacy_CSR_Light6 = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight6 >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_Adaptive = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRAdaptive >; +using SparseMatrixLegacy_CSR_Adaptive = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRAdaptive >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_MultiVector = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRMultiVector >; +using SparseMatrixLegacy_CSR_MultiVector = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRMultiVector >; template< typename Real, typename Device, typename Index > -using SparseMatrixLegacy_CSR_LightWithoutAtomic = Matrices::Legacy::CSR< Real, Device, Index, Matrices::Legacy::CSRLightWithoutAtomic >; +using SparseMatrixLegacy_CSR_LightWithoutAtomic = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLightWithoutAtomic >; // Get the name (with extension) of input matrix file std::string getMatrixFileName( const String& InputFileName ) @@ -239,8 +239,8 @@ benchmarkSpmvSynthetic( Benchmark& benchmark, const String& inputFileName, bool verboseMR ) { - using CSRHostMatrix = Matrices::Legacy::CSR< Real, Devices::Host, int >; - using CSRCudaMatrix = Matrices::Legacy::CSR< Real, Devices::Cuda, int >; + using CSRHostMatrix = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Devices::Host, int >; + using CSRCudaMatrix = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Devices::Cuda, int >; using HostVector = Containers::Vector< Real, Devices::Host, int >; using CudaVector = Containers::Vector< Real, Devices::Cuda, int >; @@ -318,6 +318,7 @@ benchmarkSpmvSynthetic( Benchmark& benchmark, benchmark.time< Devices::Cuda >( resetCusparseVectors, "GPU", spmvCusparse, cusparseBenchmarkResults ); #endif + using namespace Benchmarks::SpMV::ReferenceFormats; benchmarkSpMV< Real, SparseMatrixLegacy_CSR_Scalar >( benchmark, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrixLegacy_CSR_Vector >( benchmark, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrixLegacy_CSR_Light >( benchmark, hostOutVector, inputFileName, verboseMR ); @@ -333,13 +334,13 @@ benchmarkSpmvSynthetic( Benchmark& benchmark, benchmarkSpMV< Real, SparseMatrix_CSR_Vector >( benchmark, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrix_CSR_Hybrid >( benchmark, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrix_CSR_Adaptive >( benchmark, hostOutVector, inputFileName, verboseMR ); - benchmarkSpMV< Real, Matrices::Legacy::Ellpack >( benchmark, hostOutVector, inputFileName, verboseMR ); + benchmarkSpMV< Real, Legacy::Ellpack >( benchmark, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrix_Ellpack >( benchmark, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, SlicedEllpackAlias >( benchmark, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrix_SlicedEllpack >( benchmark, hostOutVector, inputFileName, verboseMR ); - benchmarkSpMV< Real, Matrices::Legacy::ChunkedEllpack >( benchmark, hostOutVector, inputFileName, verboseMR ); + benchmarkSpMV< Real, Legacy::ChunkedEllpack >( benchmark, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrix_ChunkedEllpack >( benchmark, hostOutVector, inputFileName, verboseMR ); - benchmarkSpMV< Real, Matrices::Legacy::BiEllpack >( benchmark, hostOutVector, inputFileName, verboseMR ); + benchmarkSpMV< Real, Legacy::BiEllpack >( benchmark, hostOutVector, inputFileName, verboseMR ); benchmarkSpMV< Real, SparseMatrix_BiEllpack >( benchmark, hostOutVector, inputFileName, verboseMR ); /* AdEllpack is broken benchmarkSpMV< Real, Matrices::AdEllpack >( benchmark, hostOutVector, inputFileName, verboseMR ); diff --git a/src/TNL/Matrices/Matrix.h b/src/TNL/Matrices/Matrix.h index 7ddbd115d55695fbe1993b657ed12bc8d1d83978..702e79162d9c6984892df845811ef10e4cdff59f 100644 --- a/src/TNL/Matrices/Matrix.h +++ b/src/TNL/Matrices/Matrix.h @@ -20,7 +20,7 @@ namespace TNL { /** - * \brief Namespace for matrices of different types. + * \brief Namespace for different matrix types. */ namespace Matrices { diff --git a/src/TNL/Matrices/MatrixInfo.h b/src/TNL/Matrices/MatrixInfo.h index 2715d2f6e19855a156fc8e424a643590abd96201..7d28956163f695fd708cff3075d5d967373ea795 100644 --- a/src/TNL/Matrices/MatrixInfo.h +++ b/src/TNL/Matrices/MatrixInfo.h @@ -18,7 +18,7 @@ #include <TNL/Algorithms/Segments/CSRView.h> #include <TNL/Algorithms/Segments/EllpackView.h> #include <TNL/Algorithms/Segments/SlicedEllpackView.h> -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack.h> @@ -82,7 +82,7 @@ struct MatrixInfo< SparseMatrix< Real, Device, Index, MatrixType, Segments, Real ///// // Legacy matrices template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::BiEllpack< Real, Device, Index > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::BiEllpack< Real, Device, Index > > { static String getDensity() { return String( "sparse" ); }; @@ -90,7 +90,7 @@ struct MatrixInfo< Legacy::BiEllpack< Real, Device, Index > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRScalar > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRScalar > > { static String getDensity() { return String( "sparse" ); }; @@ -98,7 +98,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRScalar > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRVector> > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRVector> > { static String getDensity() { return String( "sparse" ); }; @@ -106,7 +106,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRVector> > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight > > { static String getDensity() { return String( "sparse" ); }; @@ -114,7 +114,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight2 > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight2 > > { static String getDensity() { return String( "sparse" ); }; @@ -122,7 +122,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight2 > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight3 > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight3 > > { static String getDensity() { return String( "sparse" ); }; @@ -130,7 +130,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight3 > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight4 > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight4 > > { static String getDensity() { return String( "sparse" ); }; @@ -138,7 +138,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight4 > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight5 > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight5 > > { static String getDensity() { return String( "sparse" ); }; @@ -146,7 +146,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight5 > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight6 > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLight6 > > { static String getDensity() { return String( "sparse" ); }; @@ -154,7 +154,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLight6 > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRAdaptive > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRAdaptive > > { static String getDensity() { return String( "sparse" ); }; @@ -162,7 +162,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRAdaptive > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRMultiVector > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRMultiVector > > { static String getDensity() { return String( "sparse" ); }; @@ -170,7 +170,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRMultiVector > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLightWithoutAtomic > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< Real, Device, Index, Benchmarks::SpMV::ReferenceFormats::Legacy::CSRLightWithoutAtomic > > { static String getDensity() { return String( "sparse" ); }; @@ -178,7 +178,7 @@ struct MatrixInfo< Legacy::CSR< Real, Device, Index, Legacy::CSRLightWithoutAtom }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::ChunkedEllpack< Real, Device, Index > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::ChunkedEllpack< Real, Device, Index > > { static String getDensity() { return String( "sparse" ); }; @@ -186,7 +186,7 @@ struct MatrixInfo< Legacy::ChunkedEllpack< Real, Device, Index > > }; template< typename Real, typename Device, typename Index > -struct MatrixInfo< Legacy::Ellpack< Real, Device, Index > > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::Ellpack< Real, Device, Index > > { static String getDensity() { return String( "sparse" ); }; @@ -194,7 +194,7 @@ struct MatrixInfo< Legacy::Ellpack< Real, Device, Index > > }; template< typename Real, typename Device, typename Index, int SliceSize > -struct MatrixInfo< Legacy::SlicedEllpack< Real, Device, Index, SliceSize> > +struct MatrixInfo< Benchmarks::SpMV::ReferenceFormats::Legacy::SlicedEllpack< Real, Device, Index, SliceSize> > { static String getDensity() { return String( "sparse" ); }; diff --git a/src/TNL/Solvers/Linear/Preconditioners/ILU0.h b/src/TNL/Solvers/Linear/Preconditioners/ILU0.h index 8791b95e2500cc415e311935348aa791bcc8fd93..f72f398257eea2b084b4b5372a6adc0de8c93fc6 100644 --- a/src/TNL/Solvers/Linear/Preconditioners/ILU0.h +++ b/src/TNL/Solvers/Linear/Preconditioners/ILU0.h @@ -20,7 +20,7 @@ #include <TNL/Exceptions/NotImplementedError.h> #if defined(HAVE_CUDA) && defined(HAVE_CUSPARSE) -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include <cusparse.h> #endif @@ -136,7 +136,7 @@ public: protected: #if defined(HAVE_CUDA) && defined(HAVE_CUSPARSE) - using CSR = Matrices::Legacy::CSR< RealType, DeviceType, IndexType >; + using CSR = Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< RealType, DeviceType, IndexType >; Pointers::UniquePointer< CSR > A, L, U; Containers::Vector< RealType, DeviceType, IndexType > y; diff --git a/src/UnitTests/Matrices/BinarySparseMatrixCopyTest.h b/src/UnitTests/Matrices/BinarySparseMatrixCopyTest.h index 722ed5c6d21ff8d4993e26dbfbff0680fa07b8c8..0f2b00595b2e7c98f696a460adce304497545f67 100644 --- a/src/UnitTests/Matrices/BinarySparseMatrixCopyTest.h +++ b/src/UnitTests/Matrices/BinarySparseMatrixCopyTest.h @@ -8,7 +8,7 @@ /* See Copyright Notice in tnl/Copyright */ -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h> diff --git a/src/UnitTests/Matrices/DenseMatrixCopyTest.h b/src/UnitTests/Matrices/DenseMatrixCopyTest.h index 9e5794d0d9b276f6c63a48a9d88817343f5c5f3f..fb1277ea2c38752f79fcdc6aa4eccaa7db0d0a18 100644 --- a/src/UnitTests/Matrices/DenseMatrixCopyTest.h +++ b/src/UnitTests/Matrices/DenseMatrixCopyTest.h @@ -8,7 +8,7 @@ /* See Copyright Notice in tnl/Copyright */ -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h> diff --git a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest.h b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest.h index db79594387b88fc67a3db7e2fec212577537d1f8..b303876dd41b5baf4f6f2f35ea1b64c3574730d8 100644 --- a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest.h +++ b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest.h @@ -8,7 +8,7 @@ /* See Copyright Notice in tnl/Copyright */ -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include "Legacy_SparseMatrixTest.hpp" #include <iostream> @@ -16,11 +16,11 @@ #ifdef HAVE_GTEST #include <gtest/gtest.h> -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_host_float = TNL::Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< float, TNL::Devices::Host, int >; +using CSR_host_int = TNL::Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< int, TNL::Devices::Host, 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 >; +using CSR_cuda_float = TNL::Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< float, TNL::Devices::Cuda, int >; +using CSR_cuda_int = TNL::Benchmarks::SpMV::ReferenceFormats::Legacy::CSR< int, TNL::Devices::Cuda, int >; TEST( SparseMatrixTest, CSR_perforSORIterationTest_Host ) { diff --git a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest.hpp b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest.hpp index 1023186c499cda7e2c51b0ab24c05aea5caf402a..fe856cde3e5c6f133245d346296982fce2a67810 100644 --- a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest.hpp +++ b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest.hpp @@ -16,7 +16,7 @@ // Temporary, until test_OperatorEquals doesn't work for all formats. #include <Benchmarks/SpMV/ReferenceFormats/Legacy/ChunkedEllpack.h> -#include <TNL/Matrices/Legacy/AdEllpack.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/AdEllpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/BiEllpack.h> #ifdef HAVE_GTEST @@ -1657,12 +1657,13 @@ void test_OperatorEquals() using DeviceType = typename Matrix::DeviceType; using IndexType = typename Matrix::IndexType; + using namespace TNL::Benchmarks::SpMV::ReferenceFormats; if( std::is_same< DeviceType, TNL::Devices::Cuda >::value ) return; else { - using AdELL_host = TNL::Matrices::Legacy::AdEllpack< RealType, TNL::Devices::Host, IndexType >; - using AdELL_cuda = TNL::Matrices::Legacy::AdEllpack< RealType, TNL::Devices::Cuda, IndexType >; + using AdELL_host = Legacy::AdEllpack< RealType, TNL::Devices::Host, IndexType >; + using AdELL_cuda = Legacy::AdEllpack< RealType, TNL::Devices::Cuda, IndexType >; /* * Sets up the following 8x8 sparse matrix: diff --git a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_BiEllpack.h b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_BiEllpack.h index e443a61783e4d3a9b0811b6e5e3f1975750342a0..e2ee5c15e895e21c03c08142d198dfd5404bdac5 100644 --- a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_BiEllpack.h +++ b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_BiEllpack.h @@ -24,26 +24,27 @@ protected: using BiEllpackMatrixType = Matrix; }; +using namespace TNL::Benchmarks::SpMV::ReferenceFormats; // types for which MatrixTest is instantiated using BiEllpackMatrixTypes = ::testing::Types < - 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 > + Legacy::BiEllpack< int, TNL::Devices::Host, int >, + Legacy::BiEllpack< long, TNL::Devices::Host, int >, + Legacy::BiEllpack< float, TNL::Devices::Host, int >, + Legacy::BiEllpack< double, TNL::Devices::Host, int >, + Legacy::BiEllpack< int, TNL::Devices::Host, long >, + Legacy::BiEllpack< long, TNL::Devices::Host, long >, + Legacy::BiEllpack< float, TNL::Devices::Host, long >, + Legacy::BiEllpack< double, TNL::Devices::Host, long > #ifdef HAVE_CUDA - ,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 > + ,Legacy::BiEllpack< int, TNL::Devices::Cuda, int >, + Legacy::BiEllpack< long, TNL::Devices::Cuda, int >, + Legacy::BiEllpack< float, TNL::Devices::Cuda, int >, + Legacy::BiEllpack< double, TNL::Devices::Cuda, int >, + Legacy::BiEllpack< int, TNL::Devices::Cuda, long >, + Legacy::BiEllpack< long, TNL::Devices::Cuda, long >, + Legacy::BiEllpack< float, TNL::Devices::Cuda, long >, + Legacy::BiEllpack< double, TNL::Devices::Cuda, long > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_CSR.h b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_CSR.h index c43185c141c250f975a2a3a0237d214df5e1e874..33aaab2607e05e331acccd3d765772fa97fac882 100644 --- a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_CSR.h +++ b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_CSR.h @@ -8,7 +8,7 @@ /* See Copyright Notice in tnl/Copyright */ -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include "Legacy_SparseMatrixTest.hpp" #include <iostream> @@ -24,58 +24,54 @@ protected: using CSRMatrixType = Matrix; }; +using namespace TNL::Benchmarks::SpMV::ReferenceFormats; + // types for which MatrixTest is instantiated using CSRMatrixTypes = ::testing::Types < - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Host, int, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Host, int, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Host, int, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Host, long, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Host, long, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Host, long, TNL::Matrices::Legacy::CSRScalar > + Legacy::CSR< int, TNL::Devices::Host, int, Legacy::CSRScalar >, + Legacy::CSR< float, TNL::Devices::Host, int, Legacy::CSRScalar >, + Legacy::CSR< double, TNL::Devices::Host, int, Legacy::CSRScalar >, + Legacy::CSR< int, TNL::Devices::Host, long, Legacy::CSRScalar >, + Legacy::CSR< float, TNL::Devices::Host, long, Legacy::CSRScalar >, + Legacy::CSR< double, TNL::Devices::Host, long, Legacy::CSRScalar > #ifdef HAVE_CUDA - ,TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRScalar >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRVector >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRVector >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRVector >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRVector >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRVector >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRVector >, - /*TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRHybrid >, // Not implemented - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRHybrid >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRHybrid >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRHybrid >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRHybrid >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRHybrid >,*/ - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRLight >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRLight >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRLight >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRLight >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRLight >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRLight >, - /*TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRAdaptive >, // Does not work, needs to be fixed. - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRAdaptive >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRAdaptive >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRAdaptive >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRAdaptive >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRAdaptive >,*/ - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRMultiVector >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRMultiVector >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRMultiVector >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRMultiVector >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRMultiVector >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRMultiVector >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRLightWithoutAtomic >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRLightWithoutAtomic >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, int, TNL::Matrices::Legacy::CSRLightWithoutAtomic >, - TNL::Matrices::Legacy::CSR< int, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRLightWithoutAtomic >, - TNL::Matrices::Legacy::CSR< float, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRLightWithoutAtomic >, - TNL::Matrices::Legacy::CSR< double, TNL::Devices::Cuda, long, TNL::Matrices::Legacy::CSRLightWithoutAtomic > + ,Legacy::CSR< int, TNL::Devices::Cuda, int, Legacy::CSRScalar >, + Legacy::CSR< float, TNL::Devices::Cuda, int, Legacy::CSRScalar >, + Legacy::CSR< double, TNL::Devices::Cuda, int, Legacy::CSRScalar >, + Legacy::CSR< int, TNL::Devices::Cuda, long, Legacy::CSRScalar >, + Legacy::CSR< float, TNL::Devices::Cuda, long, Legacy::CSRScalar >, + Legacy::CSR< double, TNL::Devices::Cuda, long, Legacy::CSRScalar >, + Legacy::CSR< int, TNL::Devices::Cuda, int, Legacy::CSRVector >, + Legacy::CSR< float, TNL::Devices::Cuda, int, Legacy::CSRVector >, + Legacy::CSR< double, TNL::Devices::Cuda, int, Legacy::CSRVector >, + Legacy::CSR< int, TNL::Devices::Cuda, long, Legacy::CSRVector >, + Legacy::CSR< float, TNL::Devices::Cuda, long, Legacy::CSRVector >, + Legacy::CSR< double, TNL::Devices::Cuda, long, Legacy::CSRVector >, + Legacy::CSR< int, TNL::Devices::Cuda, int, Legacy::CSRLight >, + Legacy::CSR< float, TNL::Devices::Cuda, int, Legacy::CSRLight >, + Legacy::CSR< double, TNL::Devices::Cuda, int, Legacy::CSRLight >, + Legacy::CSR< int, TNL::Devices::Cuda, long, Legacy::CSRLight >, + Legacy::CSR< float, TNL::Devices::Cuda, long, Legacy::CSRLight >, + Legacy::CSR< double, TNL::Devices::Cuda, long, Legacy::CSRLight >, + /*Legacy::CSR< int, TNL::Devices::Cuda, int, Legacy::CSRAdaptive >, // Does not work, needs to be fixed. + Legacy::CSR< float, TNL::Devices::Cuda, int, Legacy::CSRAdaptive >, + Legacy::CSR< double, TNL::Devices::Cuda, int, Legacy::CSRAdaptive >, + Legacy::CSR< int, TNL::Devices::Cuda, long, Legacy::CSRAdaptive >, + Legacy::CSR< float, TNL::Devices::Cuda, long, Legacy::CSRAdaptive >, + Legacy::CSR< double, TNL::Devices::Cuda, long, Legacy::CSRAdaptive >,*/ + Legacy::CSR< int, TNL::Devices::Cuda, int, Legacy::CSRMultiVector >, + Legacy::CSR< float, TNL::Devices::Cuda, int, Legacy::CSRMultiVector >, + Legacy::CSR< double, TNL::Devices::Cuda, int, Legacy::CSRMultiVector >, + Legacy::CSR< int, TNL::Devices::Cuda, long, Legacy::CSRMultiVector >, + Legacy::CSR< float, TNL::Devices::Cuda, long, Legacy::CSRMultiVector >, + Legacy::CSR< double, TNL::Devices::Cuda, long, Legacy::CSRMultiVector >, + Legacy::CSR< int, TNL::Devices::Cuda, int, Legacy::CSRLightWithoutAtomic >, + Legacy::CSR< float, TNL::Devices::Cuda, int, Legacy::CSRLightWithoutAtomic >, + Legacy::CSR< double, TNL::Devices::Cuda, int, Legacy::CSRLightWithoutAtomic >, + Legacy::CSR< int, TNL::Devices::Cuda, long, Legacy::CSRLightWithoutAtomic >, + Legacy::CSR< float, TNL::Devices::Cuda, long, Legacy::CSRLightWithoutAtomic >, + Legacy::CSR< double, TNL::Devices::Cuda, long, Legacy::CSRLightWithoutAtomic > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_ChunkedEllpack.h b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_ChunkedEllpack.h index 84d0151887b5e8f2c08afe5c6f2811539d0b9935..1391e8be5a4a26618c85803055949d4ca4b249a8 100644 --- a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_ChunkedEllpack.h +++ b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_ChunkedEllpack.h @@ -24,27 +24,28 @@ protected: using ChunkedEllpackMatrixType = Matrix; }; +using namespace TNL::Benchmarks::SpMV::ReferenceFormats; // types for which MatrixTest is instantiated using ChEllpackMatrixTypes = ::testing::Types < - 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 > + Legacy::ChunkedEllpack< int, TNL::Devices::Host, int >, + Legacy::ChunkedEllpack< long, TNL::Devices::Host, int >, + Legacy::ChunkedEllpack< float, TNL::Devices::Host, int >, + Legacy::ChunkedEllpack< double, TNL::Devices::Host, int >, + Legacy::ChunkedEllpack< int, TNL::Devices::Host, long >, + Legacy::ChunkedEllpack< long, TNL::Devices::Host, long >, + Legacy::ChunkedEllpack< float, TNL::Devices::Host, long >, + Legacy::ChunkedEllpack< double, TNL::Devices::Host, long > #ifdef HAVE_CUDA - ,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 > + ,Legacy::ChunkedEllpack< int, TNL::Devices::Cuda, int >, + Legacy::ChunkedEllpack< long, TNL::Devices::Cuda, int >, + Legacy::ChunkedEllpack< float, TNL::Devices::Cuda, int >, + Legacy::ChunkedEllpack< double, TNL::Devices::Cuda, int >, + Legacy::ChunkedEllpack< int, TNL::Devices::Cuda, long >, + Legacy::ChunkedEllpack< long, TNL::Devices::Cuda, long >, + Legacy::ChunkedEllpack< float, TNL::Devices::Cuda, long >, + Legacy::ChunkedEllpack< double, TNL::Devices::Cuda, long > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_Ellpack.h b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_Ellpack.h index 307e5728a9114ccbf37c68182f33f55dc1158a1a..71a15d867d39585fa3b79a1df6d0f0aa29e2297c 100644 --- a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_Ellpack.h +++ b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_Ellpack.h @@ -24,26 +24,28 @@ protected: using EllpackMatrixType = Matrix; }; +using namespace TNL::Benchmarks::SpMV::ReferenceFormats; + // types for which MatrixTest is instantiated using EllpackMatrixTypes = ::testing::Types < - 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 > + Legacy::Ellpack< int, TNL::Devices::Host, int >, + Legacy::Ellpack< long, TNL::Devices::Host, int >, + Legacy::Ellpack< float, TNL::Devices::Host, int >, + Legacy::Ellpack< double, TNL::Devices::Host, int >, + Legacy::Ellpack< int, TNL::Devices::Host, long >, + Legacy::Ellpack< long, TNL::Devices::Host, long >, + Legacy::Ellpack< float, TNL::Devices::Host, long >, + Legacy::Ellpack< double, TNL::Devices::Host, long > #ifdef HAVE_CUDA - ,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 > + ,Legacy::Ellpack< int, TNL::Devices::Cuda, int >, + Legacy::Ellpack< long, TNL::Devices::Cuda, int >, + Legacy::Ellpack< float, TNL::Devices::Cuda, int >, + Legacy::Ellpack< double, TNL::Devices::Cuda, int >, + Legacy::Ellpack< int, TNL::Devices::Cuda, long >, + Legacy::Ellpack< long, TNL::Devices::Cuda, long >, + Legacy::Ellpack< float, TNL::Devices::Cuda, long >, + Legacy::Ellpack< double, TNL::Devices::Cuda, long > #endif >; diff --git a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_SlicedEllpack.h b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_SlicedEllpack.h index b975c9c602248232de799e0e7dc09b0c9ce35e00..02c2c52969c60af0bb2504027b0350db7d32d7e4 100644 --- a/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_SlicedEllpack.h +++ b/src/UnitTests/Matrices/Legacy/Legacy_SparseMatrixTest_SlicedEllpack.h @@ -25,8 +25,10 @@ protected: using SlicedEllpackMatrixType = Matrix; }; +using namespace TNL::Benchmarks::SpMV::ReferenceFormats; + template< typename Real, typename Device, typename Index > -using SlicedEllpackType = TNL::Matrices::Legacy::SlicedEllpack< Real, Device, Index, 32 >; +using SlicedEllpackType = Legacy::SlicedEllpack< Real, Device, Index, 32 >; // types for which MatrixTest is instantiated diff --git a/src/UnitTests/Matrices/SparseMatrixCopyTest.h b/src/UnitTests/Matrices/SparseMatrixCopyTest.h index 4ec2b7435dc293df3f01f61e996d67ed542d9e9a..098a3e0a41a43fb51223dff10452b7499fe9c58c 100644 --- a/src/UnitTests/Matrices/SparseMatrixCopyTest.h +++ b/src/UnitTests/Matrices/SparseMatrixCopyTest.h @@ -8,7 +8,7 @@ /* See Copyright Notice in tnl/Copyright */ -#include <TNL/Matrices/Legacy/CSR.h> +#include <Benchmarks/SpMV/ReferenceFormats/Legacy/CSR.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/Ellpack.h> #include <Benchmarks/SpMV/ReferenceFormats/Legacy/SlicedEllpack.h>