diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest.cu b/src/UnitTests/Matrices/BinarySparseMatrixTest_CSR.cpp similarity index 78% rename from src/UnitTests/Matrices/BinarySparseMatrixTest.cu rename to src/UnitTests/Matrices/BinarySparseMatrixTest_CSR.cpp index 916f14360e63f7cc48b6b26b438cd7535eff45e1..b1f4891053e1f1ad51873d3e6f8797d8477914b2 100644 --- a/src/UnitTests/Matrices/BinarySparseMatrixTest.cu +++ b/src/UnitTests/Matrices/BinarySparseMatrixTest_CSR.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - BinarySparseMatrixTest.cu - description + BinarySparseMatrixTest_CSR.cpp - description ------------------- begin : Jan 30, 2020 copyright : (C) 2020 by Tomas Oberhuber et al. @@ -8,4 +8,4 @@ /* See Copyright Notice in tnl/Copyright */ -#include "BinarySparseMatrixTest.h" \ No newline at end of file +#include "BinarySparseMatrixTest_CSR.h" \ No newline at end of file diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest.cpp b/src/UnitTests/Matrices/BinarySparseMatrixTest_CSR.cu similarity index 78% rename from src/UnitTests/Matrices/BinarySparseMatrixTest.cpp rename to src/UnitTests/Matrices/BinarySparseMatrixTest_CSR.cu index ea7b8d3c9207cca8f17064cb1cbc2df1247b9c5d..496bdde1b301ab06cd73221b17acb27ba7a80b34 100644 --- a/src/UnitTests/Matrices/BinarySparseMatrixTest.cpp +++ b/src/UnitTests/Matrices/BinarySparseMatrixTest_CSR.cu @@ -1,5 +1,5 @@ /*************************************************************************** - BinarySparseMatrixTest.cpp - description + BinarySparseMatrixTest_CSR.cu - description ------------------- begin : Jan 30, 2020 copyright : (C) 2020 by Tomas Oberhuber et al. @@ -8,4 +8,4 @@ /* See Copyright Notice in tnl/Copyright */ -#include "BinarySparseMatrixTest.h" \ No newline at end of file +#include "BinarySparseMatrixTest_CSR.h" \ No newline at end of file diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest.h b/src/UnitTests/Matrices/BinarySparseMatrixTest_CSR.h similarity index 87% rename from src/UnitTests/Matrices/BinarySparseMatrixTest.h rename to src/UnitTests/Matrices/BinarySparseMatrixTest_CSR.h index cb0d0bab577800215c3495e0ae796e2408ce873b..9cd52741a89b02668339c18e876581fbe4b28b74 100644 --- a/src/UnitTests/Matrices/BinarySparseMatrixTest.h +++ b/src/UnitTests/Matrices/BinarySparseMatrixTest_CSR.h @@ -1,5 +1,5 @@ /*************************************************************************** - BinarySparseMatrixTest.h - description + BinarySparseMatrixTest_CSR.h - description ------------------- begin : Jan 30, 2020 copyright : (C) 2020 by Tomas Oberhuber et al. @@ -20,7 +20,7 @@ // test fixture for typed tests template< typename Matrix > -class CSRMatrixTest : public ::testing::Test +class BinaryMatrixTest_CSR : public ::testing::Test { protected: using CSRMatrixType = Matrix; @@ -57,37 +57,37 @@ using CSRMatrixTypes = ::testing::Types #endif >; -TYPED_TEST_SUITE( CSRMatrixTest, CSRMatrixTypes); +TYPED_TEST_SUITE( BinaryMatrixTest_CSR, CSRMatrixTypes); -TYPED_TEST( CSRMatrixTest, setDimensionsTest ) +TYPED_TEST( BinaryMatrixTest_CSR, setDimensionsTest ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; test_SetDimensions< CSRMatrixType >(); } -TYPED_TEST( CSRMatrixTest, setCompressedRowLengthsTest ) +TYPED_TEST( BinaryMatrixTest_CSR, setCompressedRowLengthsTest ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; test_SetCompressedRowLengths< CSRMatrixType >(); } -TYPED_TEST( CSRMatrixTest, setLikeTest ) +TYPED_TEST( BinaryMatrixTest_CSR, setLikeTest ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; test_SetLike< CSRMatrixType, CSRMatrixType >(); } -TYPED_TEST( CSRMatrixTest, resetTest ) +TYPED_TEST( BinaryMatrixTest_CSR, resetTest ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; test_Reset< CSRMatrixType >(); } -TYPED_TEST( CSRMatrixTest, getRowTest ) +TYPED_TEST( BinaryMatrixTest_CSR, getRowTest ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; @@ -95,35 +95,35 @@ TYPED_TEST( CSRMatrixTest, getRowTest ) } -TYPED_TEST( CSRMatrixTest, setElementTest ) +TYPED_TEST( BinaryMatrixTest_CSR, setElementTest ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; test_SetElement< CSRMatrixType >(); } -TYPED_TEST( CSRMatrixTest, vectorProductTest ) +TYPED_TEST( BinaryMatrixTest_CSR, vectorProductTest ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; test_VectorProduct< CSRMatrixType >(); } -TYPED_TEST( CSRMatrixTest, rowsReduction ) +TYPED_TEST( BinaryMatrixTest_CSR, rowsReduction ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; test_RowsReduction< CSRMatrixType >(); } -TYPED_TEST( CSRMatrixTest, saveAndLoadTest ) +TYPED_TEST( BinaryMatrixTest_CSR, saveAndLoadTest ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; - test_SaveAndLoad< CSRMatrixType >( "test_BinarySparseMatrixTest" ); + test_SaveAndLoad< CSRMatrixType >( "test_BinarySparseMatrixTest_CSR" ); } -TYPED_TEST( CSRMatrixTest, printTest ) +TYPED_TEST( BinaryMatrixTest_CSR, printTest ) { using CSRMatrixType = typename TestFixture::CSRMatrixType; diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest_Ellpack.cpp b/src/UnitTests/Matrices/BinarySparseMatrixTest_Ellpack.cpp new file mode 100644 index 0000000000000000000000000000000000000000..b1d5d71cf681fda25c0b0dde127dcc20c795a039 --- /dev/null +++ b/src/UnitTests/Matrices/BinarySparseMatrixTest_Ellpack.cpp @@ -0,0 +1,11 @@ +/*************************************************************************** + BinarySparseMatrixTest_Ellpack.cpp - description + ------------------- + begin : Jan 30, 2020 + copyright : (C) 2020 by Tomas Oberhuber et al. + email : tomas.oberhuber@fjfi.cvut.cz + ***************************************************************************/ + +/* See Copyright Notice in tnl/Copyright */ + +#include "BinarySparseMatrixTest_Ellpack.h" \ No newline at end of file diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest_Ellpack.cu b/src/UnitTests/Matrices/BinarySparseMatrixTest_Ellpack.cu new file mode 100644 index 0000000000000000000000000000000000000000..8d075f1cf4539b741be6e1693abe8ddd28766f74 --- /dev/null +++ b/src/UnitTests/Matrices/BinarySparseMatrixTest_Ellpack.cu @@ -0,0 +1,11 @@ +/*************************************************************************** + BinarySparseMatrixTest_Ellpack.cu - description + ------------------- + begin : Jan 30, 2020 + copyright : (C) 2020 by Tomas Oberhuber et al. + email : tomas.oberhuber@fjfi.cvut.cz + ***************************************************************************/ + +/* See Copyright Notice in tnl/Copyright */ + +#include "BinarySparseMatrixTest_Ellpack.h" \ No newline at end of file diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest_Ellpack.h b/src/UnitTests/Matrices/BinarySparseMatrixTest_Ellpack.h new file mode 100644 index 0000000000000000000000000000000000000000..708bd85f07f38a43485012f3ef5094c40919f41f --- /dev/null +++ b/src/UnitTests/Matrices/BinarySparseMatrixTest_Ellpack.h @@ -0,0 +1,146 @@ +/*************************************************************************** + BinarySparseMatrixTest_Ellpack.h - description + ------------------- + begin : Jan 30, 2020 + copyright : (C) 2020 by Tomas Oberhuber et al. + email : tomas.oberhuber@fjfi.cvut.cz + ***************************************************************************/ + +/* See Copyright Notice in tnl/Copyright */ + +#include <TNL/Containers/Segments/Ellpack.h> +#include <TNL/Matrices/SparseMatrix.h> + + +#include "BinarySparseMatrixTest.hpp" +#include <iostream> + +#ifdef HAVE_GTEST +#include <gtest/gtest.h> + +// test fixture for typed tests +template< typename Matrix > +class BinaryMatrixTest_Ellpack : public ::testing::Test +{ +protected: + using EllpackMatrixType = Matrix; +}; + +//// +// Row-major format is used for the host system +template< typename Device, typename Index, typename IndexAlocator > +using RowMajorEllpack = TNL::Containers::Segments::Ellpack< Device, Index, IndexAlocator, true, 32 >; + + +//// +// Column-major format is used for GPUs +template< typename Device, typename Index, typename IndexAllocator > +using ColumnMajorEllpack = TNL::Containers::Segments::Ellpack< Device, Index, IndexAllocator, false, 32 >; + +// types for which MatrixTest is instantiated +using EllpackMatrixTypes = ::testing::Types +< + TNL::Matrices::SparseMatrix< int, TNL::Devices::Host, short, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Host, short, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Host, short, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Host, short, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< int, TNL::Devices::Host, int, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Host, int, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Host, int, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Host, int, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< int, TNL::Devices::Host, long, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Host, long, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Host, long, TNL::Matrices::GeneralMatrix, RowMajorEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Host, long, TNL::Matrices::GeneralMatrix, RowMajorEllpack > +#ifdef HAVE_CUDA + ,TNL::Matrices::SparseMatrix< int, TNL::Devices::Cuda, short, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Cuda, short, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Cuda, short, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Cuda, short, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< int, TNL::Devices::Cuda, int, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Cuda, int, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Cuda, int, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Cuda, int, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< int, TNL::Devices::Cuda, long, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Cuda, long, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Cuda, long, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Cuda, long, TNL::Matrices::GeneralMatrix, ColumnMajorEllpack > +#endif +>; + +TYPED_TEST_SUITE( BinaryMatrixTest_Ellpack, EllpackMatrixTypes); + +TYPED_TEST( BinaryMatrixTest_Ellpack, setDimensionsTest ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_SetDimensions< EllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_Ellpack, setCompressedRowLengthsTest ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_SetCompressedRowLengths< EllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_Ellpack, setLikeTest ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_SetLike< EllpackMatrixType, EllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_Ellpack, resetTest ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_Reset< EllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_Ellpack, getRowTest ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_GetRow< EllpackMatrixType >(); +} + + +TYPED_TEST( BinaryMatrixTest_Ellpack, setElementTest ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_SetElement< EllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_Ellpack, vectorProductTest ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_VectorProduct< EllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_Ellpack, rowsReduction ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_RowsReduction< EllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_Ellpack, saveAndLoadTest ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_SaveAndLoad< EllpackMatrixType >( "test_BinarySparseMatrixTest_Ellpack" ); +} + +TYPED_TEST( BinaryMatrixTest_Ellpack, printTest ) +{ + using EllpackMatrixType = typename TestFixture::EllpackMatrixType; + + test_Print< EllpackMatrixType >(); +} + +#endif + +#include "../main.h" diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest_SlicedEllpack.cpp b/src/UnitTests/Matrices/BinarySparseMatrixTest_SlicedEllpack.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7046d815629444d3275eaae4b44d429f0ea8c3f7 --- /dev/null +++ b/src/UnitTests/Matrices/BinarySparseMatrixTest_SlicedEllpack.cpp @@ -0,0 +1,11 @@ +/*************************************************************************** + BinarySparseMatrixTest_SlicedEllpack.cpp - description + ------------------- + begin : Jan 30, 2020 + copyright : (C) 2020 by Tomas Oberhuber et al. + email : tomas.oberhuber@fjfi.cvut.cz + ***************************************************************************/ + +/* See Copyright Notice in tnl/Copyright */ + +#include "BinarySparseMatrixTest_SlicedEllpack.h" \ No newline at end of file diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest_SlicedEllpack.cu b/src/UnitTests/Matrices/BinarySparseMatrixTest_SlicedEllpack.cu new file mode 100644 index 0000000000000000000000000000000000000000..bb6829310fc45f5679bf658a9a792b72dbb0b6b9 --- /dev/null +++ b/src/UnitTests/Matrices/BinarySparseMatrixTest_SlicedEllpack.cu @@ -0,0 +1,11 @@ +/*************************************************************************** + BinarySparseMatrixTest_SlicedEllpack.cu - description + ------------------- + begin : Jan 30, 2020 + copyright : (C) 2020 by Tomas Oberhuber et al. + email : tomas.oberhuber@fjfi.cvut.cz + ***************************************************************************/ + +/* See Copyright Notice in tnl/Copyright */ + +#include "BinarySparseMatrixTest_SlicedEllpack.h" \ No newline at end of file diff --git a/src/UnitTests/Matrices/BinarySparseMatrixTest_SlicedEllpack.h b/src/UnitTests/Matrices/BinarySparseMatrixTest_SlicedEllpack.h new file mode 100644 index 0000000000000000000000000000000000000000..7ebc2596836fa908bfe19993b79fe7dfc911bd01 --- /dev/null +++ b/src/UnitTests/Matrices/BinarySparseMatrixTest_SlicedEllpack.h @@ -0,0 +1,146 @@ +/*************************************************************************** + BinarySparseMatrixTest_SlicedEllpack.h - description + ------------------- + begin : Jan 30, 2020 + copyright : (C) 2020 by Tomas Oberhuber et al. + email : tomas.oberhuber@fjfi.cvut.cz + ***************************************************************************/ + +/* See Copyright Notice in tnl/Copyright */ + +#include <TNL/Containers/Segments/SlicedEllpack.h> +#include <TNL/Matrices/SparseMatrix.h> + + +#include "BinarySparseMatrixTest.hpp" +#include <iostream> + +#ifdef HAVE_GTEST +#include <gtest/gtest.h> + +// test fixture for typed tests +template< typename Matrix > +class BinaryMatrixTest_SlicedEllpack : public ::testing::Test +{ +protected: + using SlicedEllpackMatrixType = Matrix; +}; + +//// +// Row-major format is used for the host system +template< typename Device, typename Index, typename IndexAllocator > +using RowMajorSlicedEllpack = TNL::Containers::Segments::SlicedEllpack< Device, Index, IndexAllocator, true, 32 >; + + +//// +// Column-major format is used for GPUs +template< typename Device, typename Index, typename IndexAllocator > +using ColumnMajorSlicedEllpack = TNL::Containers::Segments::SlicedEllpack< Device, Index, IndexAllocator, false, 32 >; + +// types for which MatrixTest is instantiated +using SlicedEllpackMatrixTypes = ::testing::Types +< + TNL::Matrices::SparseMatrix< int, TNL::Devices::Host, short, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Host, short, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Host, short, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Host, short, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< int, TNL::Devices::Host, int, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Host, int, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Host, int, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Host, int, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< int, TNL::Devices::Host, long, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Host, long, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Host, long, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Host, long, TNL::Matrices::GeneralMatrix, RowMajorSlicedEllpack > +#ifdef HAVE_CUDA + ,TNL::Matrices::SparseMatrix< int, TNL::Devices::Cuda, short, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Cuda, short, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Cuda, short, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Cuda, short, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< int, TNL::Devices::Cuda, int, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Cuda, int, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Cuda, int, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Cuda, int, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< int, TNL::Devices::Cuda, long, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< long, TNL::Devices::Cuda, long, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< float, TNL::Devices::Cuda, long, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack >, + TNL::Matrices::SparseMatrix< double, TNL::Devices::Cuda, long, TNL::Matrices::GeneralMatrix, ColumnMajorSlicedEllpack > +#endif +>; + +TYPED_TEST_SUITE( BinaryMatrixTest_SlicedEllpack, SlicedEllpackMatrixTypes); + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, setDimensionsTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_SetDimensions< SlicedEllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, setCompressedRowLengthsTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_SetCompressedRowLengths< SlicedEllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, setLikeTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_SetLike< SlicedEllpackMatrixType, SlicedEllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, resetTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_Reset< SlicedEllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, getRowTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_GetRow< SlicedEllpackMatrixType >(); +} + + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, setElementTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_SetElement< SlicedEllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, vectorProductTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_VectorProduct< SlicedEllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, rowsReduction ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_RowsReduction< SlicedEllpackMatrixType >(); +} + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, saveAndLoadTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_SaveAndLoad< SlicedEllpackMatrixType >( "test_BinarySparseMatrixTest" ); +} + +TYPED_TEST( BinaryMatrixTest_SlicedEllpack, printTest ) +{ + using SlicedEllpackMatrixType = typename TestFixture::SlicedEllpackMatrixType; + + test_Print< SlicedEllpackMatrixType >(); +} + +#endif + +#include "../main.h" diff --git a/src/UnitTests/Matrices/CMakeLists.txt b/src/UnitTests/Matrices/CMakeLists.txt index c4b2fabd394bb3c82e2bd63c331b54e4cc189c77..60a01eaf5e1274b12bd6a070a573a7a4a3706613 100644 --- a/src/UnitTests/Matrices/CMakeLists.txt +++ b/src/UnitTests/Matrices/CMakeLists.txt @@ -25,8 +25,14 @@ IF( BUILD_CUDA ) CUDA_ADD_EXECUTABLE( SparseMatrixCopyTest SparseMatrixCopyTest.cu OPTIONS ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} ) - CUDA_ADD_EXECUTABLE( BinarySparseMatrixTest BinarySparseMatrixTest.cu OPTIONS ${CXX_TESTS_FLAGS} ) - TARGET_LINK_LIBRARIES( BinarySparseMatrixTest ${GTEST_BOTH_LIBRARIES} ) + CUDA_ADD_EXECUTABLE( BinarySparseMatrixTest_CSR BinarySparseMatrixTest_CSR.cu OPTIONS ${CXX_TESTS_FLAGS} ) + TARGET_LINK_LIBRARIES( BinarySparseMatrixTest_CSR ${GTEST_BOTH_LIBRARIES} ) + + CUDA_ADD_EXECUTABLE( BinarySparseMatrixTest_Ellpack BinarySparseMatrixTest_Ellpack.cu OPTIONS ${CXX_TESTS_FLAGS} ) + TARGET_LINK_LIBRARIES( BinarySparseMatrixTest_Ellpack ${GTEST_BOTH_LIBRARIES} ) + + CUDA_ADD_EXECUTABLE( BinarySparseMatrixTest_SlicedEllpack BinarySparseMatrixTest_SlicedEllpack.cu OPTIONS ${CXX_TESTS_FLAGS} ) + TARGET_LINK_LIBRARIES( BinarySparseMatrixTest_SlicedEllpack ${GTEST_BOTH_LIBRARIES} ) ELSE( BUILD_CUDA ) ADD_EXECUTABLE( DenseMatrixTest DenseMatrixTest.cpp ) @@ -61,9 +67,17 @@ ELSE( BUILD_CUDA ) TARGET_COMPILE_OPTIONS( SparseMatrixCopyTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} ) - ADD_EXECUTABLE( BinarySparseMatrixTest BinarySparseMatrixTest.cpp ) - TARGET_COMPILE_OPTIONS( BinarySparseMatrixTest PRIVATE ${CXX_TESTS_FLAGS} ) - TARGET_LINK_LIBRARIES( BinarySparseMatrixTest ${GTEST_BOTH_LIBRARIES} ) + ADD_EXECUTABLE( BinarySparseMatrixTest_CSR BinarySparseMatrixTest_CSR.cpp ) + TARGET_COMPILE_OPTIONS( BinarySparseMatrixTest_CSR PRIVATE ${CXX_TESTS_FLAGS} ) + TARGET_LINK_LIBRARIES( BinarySparseMatrixTest_CSR ${GTEST_BOTH_LIBRARIES} ) + + ADD_EXECUTABLE( BinarySparseMatrixTest_Ellpack BinarySparseMatrixTest_Ellpack.cpp ) + TARGET_COMPILE_OPTIONS( BinarySparseMatrixTest_Ellpack PRIVATE ${CXX_TESTS_FLAGS} ) + TARGET_LINK_LIBRARIES( BinarySparseMatrixTest_Ellpack ${GTEST_BOTH_LIBRARIES} ) + + ADD_EXECUTABLE( BinarySparseMatrixTest_SlicedEllpack BinarySparseMatrixTest_SlicedEllpack.cpp ) + TARGET_COMPILE_OPTIONS( BinarySparseMatrixTest_SlicedEllpack PRIVATE ${CXX_TESTS_FLAGS} ) + TARGET_LINK_LIBRARIES( BinarySparseMatrixTest_SlicedEllpack ${GTEST_BOTH_LIBRARIES} ) ENDIF( BUILD_CUDA ) @@ -75,7 +89,9 @@ ADD_TEST( MultidiagonalMatrixTest ${EXECUTABLE_OUTPUT_PATH}/MultidiagonalMatrixT ADD_TEST( SparseMatrixTest_CSR ${EXECUTABLE_OUTPUT_PATH}/SparseMatrixTest_CSR${CMAKE_EXECUTABLE_SUFFIX} ) ADD_TEST( SparseMatrixTest_Ellpack ${EXECUTABLE_OUTPUT_PATH}/SparseMatrixTest_Ellpack${CMAKE_EXECUTABLE_SUFFIX} ) ADD_TEST( SparseMatrixTest_SlicedEllpack ${EXECUTABLE_OUTPUT_PATH}/SparseMatrixTest_SlicedEllpack${CMAKE_EXECUTABLE_SUFFIX} ) -ADD_TEST( BinarySparseMatrixTest ${EXECUTABLE_OUTPUT_PATH}/BinarySparseMatrixTest${CMAKE_EXECUTABLE_SUFFIX} ) +ADD_TEST( BinarySparseMatrixTest_CSR ${EXECUTABLE_OUTPUT_PATH}/BinarySparseMatrixTest_CSR${CMAKE_EXECUTABLE_SUFFIX} ) +ADD_TEST( BinarySparseMatrixTest_Ellpack ${EXECUTABLE_OUTPUT_PATH}/BinarySparseMatrixTest_Ellpack${CMAKE_EXECUTABLE_SUFFIX} ) +ADD_TEST( BinarySparseMatrixTest_SlicedEllpack ${EXECUTABLE_OUTPUT_PATH}/BinarySparseMatrixTest_SlicedEllpack${CMAKE_EXECUTABLE_SUFFIX} ) if( ${BUILD_MPI} ) if( BUILD_CUDA ) diff --git a/src/UnitTests/Matrices/SparseMatrixTest_CSR.cu b/src/UnitTests/Matrices/SparseMatrixTest_CSR.cu index 771c74b9a2f93bb87236e902a1bf2f9fe3c6d96f..258ad2c53831010111eeec9dc240368ae5dffb35 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest_CSR.cu +++ b/src/UnitTests/Matrices/SparseMatrixTest_CSR.cu @@ -1 +1 @@ -#include "SparseMatrixTest_CSR_segments.h" +#include "SparseMatrixTest_CSR.h" diff --git a/src/UnitTests/Matrices/SparseMatrixTest_CSR.h b/src/UnitTests/Matrices/SparseMatrixTest_CSR.h index 1e89d544a72cf0b2f0b3297ec2e47ae152ca5e13..781735e7f5162bf4469828eb5f742398e9d40832 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest_CSR.h +++ b/src/UnitTests/Matrices/SparseMatrixTest_CSR.h @@ -1,5 +1,5 @@ /*************************************************************************** - SparseMatrixTest_CSR_segments.h - description + SparseMatrixTest_CSR.h - description ------------------- begin : Dec 2, 2019 copyright : (C) 2019 by Tomas Oberhuber et al. diff --git a/src/UnitTests/Matrices/SparseMatrixTest_Ellpack.cu b/src/UnitTests/Matrices/SparseMatrixTest_Ellpack.cu index 63219e9b075b6334346e397f8ad3949ae6a5781d..c454706f0b1d437b798f2d7a1e93ccf4c0291d3f 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest_Ellpack.cu +++ b/src/UnitTests/Matrices/SparseMatrixTest_Ellpack.cu @@ -1 +1 @@ -#include "SparseMatrixTest_Ellpack_segments.h" +#include "SparseMatrixTest_Ellpack.h" diff --git a/src/UnitTests/Matrices/SparseMatrixTest_Ellpack.h b/src/UnitTests/Matrices/SparseMatrixTest_Ellpack.h index 32678c2b0c3f4bd3a3b4d5f4a20015a7bfcc1704..9650105f6037d827c3a8d96d032df3fc1d320c42 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest_Ellpack.h +++ b/src/UnitTests/Matrices/SparseMatrixTest_Ellpack.h @@ -1,5 +1,5 @@ /*************************************************************************** - SparseMatrixTest_Ellpack_segments.h - description + SparseMatrixTest_Ellpack.h - description ------------------- begin : Dec 3, 2019 copyright : (C) 2019 by Tomas Oberhuber et al. diff --git a/src/UnitTests/Matrices/SparseMatrixTest_SlicedEllpack.cu b/src/UnitTests/Matrices/SparseMatrixTest_SlicedEllpack.cu index a88301100dd94be8d859e545ea9a03cc98f4da73..40e2e94b81ca64051ddceee82f46dd2d20e66e42 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest_SlicedEllpack.cu +++ b/src/UnitTests/Matrices/SparseMatrixTest_SlicedEllpack.cu @@ -1 +1 @@ -#include "SparseMatrixTest_SlicedEllpack_segments.h" +#include "SparseMatrixTest_SlicedEllpack.h"