Skip to content
Snippets Groups Projects
Commit 9ee9e376 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Tomáš Oberhuber
Browse files

Added binary sparse matrix unit tests for Ellpack and SlicedEllpack.

parent 4126b7c3
No related branches found
No related tags found
1 merge request!48Segments
Showing
with 381 additions and 29 deletions
/*************************************************************************** /***************************************************************************
BinarySparseMatrixTest.cu - description BinarySparseMatrixTest_CSR.cpp - description
------------------- -------------------
begin : Jan 30, 2020 begin : Jan 30, 2020
copyright : (C) 2020 by Tomas Oberhuber et al. copyright : (C) 2020 by Tomas Oberhuber et al.
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
/* See Copyright Notice in tnl/Copyright */ /* See Copyright Notice in tnl/Copyright */
#include "BinarySparseMatrixTest.h" #include "BinarySparseMatrixTest_CSR.h"
\ No newline at end of file \ No newline at end of file
/*************************************************************************** /***************************************************************************
BinarySparseMatrixTest.cpp - description BinarySparseMatrixTest_CSR.cu - description
------------------- -------------------
begin : Jan 30, 2020 begin : Jan 30, 2020
copyright : (C) 2020 by Tomas Oberhuber et al. copyright : (C) 2020 by Tomas Oberhuber et al.
...@@ -8,4 +8,4 @@ ...@@ -8,4 +8,4 @@
/* See Copyright Notice in tnl/Copyright */ /* See Copyright Notice in tnl/Copyright */
#include "BinarySparseMatrixTest.h" #include "BinarySparseMatrixTest_CSR.h"
\ No newline at end of file \ No newline at end of file
/*************************************************************************** /***************************************************************************
BinarySparseMatrixTest.h - description BinarySparseMatrixTest_CSR.h - description
------------------- -------------------
begin : Jan 30, 2020 begin : Jan 30, 2020
copyright : (C) 2020 by Tomas Oberhuber et al. copyright : (C) 2020 by Tomas Oberhuber et al.
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
// test fixture for typed tests // test fixture for typed tests
template< typename Matrix > template< typename Matrix >
class CSRMatrixTest : public ::testing::Test class BinaryMatrixTest_CSR : public ::testing::Test
{ {
protected: protected:
using CSRMatrixType = Matrix; using CSRMatrixType = Matrix;
...@@ -57,37 +57,37 @@ using CSRMatrixTypes = ::testing::Types ...@@ -57,37 +57,37 @@ using CSRMatrixTypes = ::testing::Types
#endif #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; using CSRMatrixType = typename TestFixture::CSRMatrixType;
test_SetDimensions< CSRMatrixType >(); test_SetDimensions< CSRMatrixType >();
} }
TYPED_TEST( CSRMatrixTest, setCompressedRowLengthsTest ) TYPED_TEST( BinaryMatrixTest_CSR, setCompressedRowLengthsTest )
{ {
using CSRMatrixType = typename TestFixture::CSRMatrixType; using CSRMatrixType = typename TestFixture::CSRMatrixType;
test_SetCompressedRowLengths< CSRMatrixType >(); test_SetCompressedRowLengths< CSRMatrixType >();
} }
TYPED_TEST( CSRMatrixTest, setLikeTest ) TYPED_TEST( BinaryMatrixTest_CSR, setLikeTest )
{ {
using CSRMatrixType = typename TestFixture::CSRMatrixType; using CSRMatrixType = typename TestFixture::CSRMatrixType;
test_SetLike< CSRMatrixType, CSRMatrixType >(); test_SetLike< CSRMatrixType, CSRMatrixType >();
} }
TYPED_TEST( CSRMatrixTest, resetTest ) TYPED_TEST( BinaryMatrixTest_CSR, resetTest )
{ {
using CSRMatrixType = typename TestFixture::CSRMatrixType; using CSRMatrixType = typename TestFixture::CSRMatrixType;
test_Reset< CSRMatrixType >(); test_Reset< CSRMatrixType >();
} }
TYPED_TEST( CSRMatrixTest, getRowTest ) TYPED_TEST( BinaryMatrixTest_CSR, getRowTest )
{ {
using CSRMatrixType = typename TestFixture::CSRMatrixType; using CSRMatrixType = typename TestFixture::CSRMatrixType;
...@@ -95,35 +95,35 @@ TYPED_TEST( CSRMatrixTest, getRowTest ) ...@@ -95,35 +95,35 @@ TYPED_TEST( CSRMatrixTest, getRowTest )
} }
TYPED_TEST( CSRMatrixTest, setElementTest ) TYPED_TEST( BinaryMatrixTest_CSR, setElementTest )
{ {
using CSRMatrixType = typename TestFixture::CSRMatrixType; using CSRMatrixType = typename TestFixture::CSRMatrixType;
test_SetElement< CSRMatrixType >(); test_SetElement< CSRMatrixType >();
} }
TYPED_TEST( CSRMatrixTest, vectorProductTest ) TYPED_TEST( BinaryMatrixTest_CSR, vectorProductTest )
{ {
using CSRMatrixType = typename TestFixture::CSRMatrixType; using CSRMatrixType = typename TestFixture::CSRMatrixType;
test_VectorProduct< CSRMatrixType >(); test_VectorProduct< CSRMatrixType >();
} }
TYPED_TEST( CSRMatrixTest, rowsReduction ) TYPED_TEST( BinaryMatrixTest_CSR, rowsReduction )
{ {
using CSRMatrixType = typename TestFixture::CSRMatrixType; using CSRMatrixType = typename TestFixture::CSRMatrixType;
test_RowsReduction< CSRMatrixType >(); test_RowsReduction< CSRMatrixType >();
} }
TYPED_TEST( CSRMatrixTest, saveAndLoadTest ) TYPED_TEST( BinaryMatrixTest_CSR, saveAndLoadTest )
{ {
using CSRMatrixType = typename TestFixture::CSRMatrixType; 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; using CSRMatrixType = typename TestFixture::CSRMatrixType;
......
/***************************************************************************
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
/***************************************************************************
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
/***************************************************************************
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"
/***************************************************************************
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
/***************************************************************************
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
/***************************************************************************
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"
...@@ -25,8 +25,14 @@ IF( BUILD_CUDA ) ...@@ -25,8 +25,14 @@ IF( BUILD_CUDA )
CUDA_ADD_EXECUTABLE( SparseMatrixCopyTest SparseMatrixCopyTest.cu OPTIONS ${CXX_TESTS_FLAGS} ) CUDA_ADD_EXECUTABLE( SparseMatrixCopyTest SparseMatrixCopyTest.cu OPTIONS ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} ) TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} )
CUDA_ADD_EXECUTABLE( BinarySparseMatrixTest BinarySparseMatrixTest.cu OPTIONS ${CXX_TESTS_FLAGS} ) CUDA_ADD_EXECUTABLE( BinarySparseMatrixTest_CSR BinarySparseMatrixTest_CSR.cu OPTIONS ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( BinarySparseMatrixTest ${GTEST_BOTH_LIBRARIES} ) 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 ) ELSE( BUILD_CUDA )
ADD_EXECUTABLE( DenseMatrixTest DenseMatrixTest.cpp ) ADD_EXECUTABLE( DenseMatrixTest DenseMatrixTest.cpp )
...@@ -61,9 +67,17 @@ ELSE( BUILD_CUDA ) ...@@ -61,9 +67,17 @@ ELSE( BUILD_CUDA )
TARGET_COMPILE_OPTIONS( SparseMatrixCopyTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_COMPILE_OPTIONS( SparseMatrixCopyTest PRIVATE ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} ) TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} )
ADD_EXECUTABLE( BinarySparseMatrixTest BinarySparseMatrixTest.cpp ) ADD_EXECUTABLE( BinarySparseMatrixTest_CSR BinarySparseMatrixTest_CSR.cpp )
TARGET_COMPILE_OPTIONS( BinarySparseMatrixTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_COMPILE_OPTIONS( BinarySparseMatrixTest_CSR PRIVATE ${CXX_TESTS_FLAGS} )
TARGET_LINK_LIBRARIES( BinarySparseMatrixTest ${GTEST_BOTH_LIBRARIES} ) 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 ) ENDIF( BUILD_CUDA )
...@@ -75,7 +89,9 @@ ADD_TEST( MultidiagonalMatrixTest ${EXECUTABLE_OUTPUT_PATH}/MultidiagonalMatrixT ...@@ -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_CSR ${EXECUTABLE_OUTPUT_PATH}/SparseMatrixTest_CSR${CMAKE_EXECUTABLE_SUFFIX} )
ADD_TEST( SparseMatrixTest_Ellpack ${EXECUTABLE_OUTPUT_PATH}/SparseMatrixTest_Ellpack${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( 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_MPI} )
if( BUILD_CUDA ) if( BUILD_CUDA )
......
#include "SparseMatrixTest_CSR_segments.h" #include "SparseMatrixTest_CSR.h"
/*************************************************************************** /***************************************************************************
SparseMatrixTest_CSR_segments.h - description SparseMatrixTest_CSR.h - description
------------------- -------------------
begin : Dec 2, 2019 begin : Dec 2, 2019
copyright : (C) 2019 by Tomas Oberhuber et al. copyright : (C) 2019 by Tomas Oberhuber et al.
......
#include "SparseMatrixTest_Ellpack_segments.h" #include "SparseMatrixTest_Ellpack.h"
/*************************************************************************** /***************************************************************************
SparseMatrixTest_Ellpack_segments.h - description SparseMatrixTest_Ellpack.h - description
------------------- -------------------
begin : Dec 3, 2019 begin : Dec 3, 2019
copyright : (C) 2019 by Tomas Oberhuber et al. copyright : (C) 2019 by Tomas Oberhuber et al.
......
#include "SparseMatrixTest_SlicedEllpack_segments.h" #include "SparseMatrixTest_SlicedEllpack.h"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment