Loading src/UnitTests/Matrices/CMakeLists.txt +11 −0 Original line number Diff line number Diff line Loading @@ -2,12 +2,23 @@ IF( BUILD_CUDA ) CUDA_ADD_EXECUTABLE( SparseMatrixCopyTest SparseMatrixCopyTest.h SparseMatrixCopyTest.cu OPTIONS ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} tnl ) CUDA_ADD_EXECUTABLE( SparseMatrixTest SparseMatrixTest.h SparseMatrixTest.cu OPTIONS ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixTest ${GTEST_BOTH_LIBRARIES} tnl ) ELSE( BUILD_CUDA ) ADD_EXECUTABLE( SparseMatrixCopyTest SparseMatrixCopyTest.h SparseMatrixCopyTest.cpp ) TARGET_COMPILE_OPTIONS( SparseMatrixCopyTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} tnl ) ADD_EXECUTABLE( SparseMatrixTest SparseMatrixTest.h SparseMatrixTest.cpp ) TARGET_COMPILE_OPTIONS( SparseMatrixTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixTest ${GTEST_BOTH_LIBRARIES} tnl ) ENDIF( BUILD_CUDA ) ADD_TEST( SparseMatrixCopyTest ${EXECUTABLE_OUTPUT_PATH}/SparseMatrixCopyTest${CMAKE_EXECUTABLE_SUFFIX} ) ADD_TEST( SparseMatrixTest ${EXECUTABLE_OUTPUT_PATH}/SparseMatrixTest${CMAKE_EXECUTABLE_SUFFIX} ) src/UnitTests/Matrices/SparseMatrixTest.h +8 −5 Original line number Diff line number Diff line Loading @@ -14,14 +14,17 @@ using CSR_host = TNL::Matrices::CSR< int, TNL::Devices::Host, int >; using CSR_cuda = TNL::Matrices::CSR< int, TNL::Devices::Cuda, int >; using E_host = TNL::Matrices::Ellpack< int, TNL::Devices::Host, int >; using E_cuda = TNL::Matrices::Ellpack< int, TNL::Devices::Cuda, int >; using SE_host = TNL::Matrices::SlicedEllpack< int, TNL::Devices::Host, int, 2 >; using SE_cuda = TNL::Matrices::SlicedEllpack< int, TNL::Devices::Cuda, int, 2 >; #ifdef HAVE_GTEST #include <gtest/gtest.h> //TODO Tests go in here template< typename Matrix > void testGetType() { Matrix<float> matrix; m; matrix.getType(); } #endif Loading Loading
src/UnitTests/Matrices/CMakeLists.txt +11 −0 Original line number Diff line number Diff line Loading @@ -2,12 +2,23 @@ IF( BUILD_CUDA ) CUDA_ADD_EXECUTABLE( SparseMatrixCopyTest SparseMatrixCopyTest.h SparseMatrixCopyTest.cu OPTIONS ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} tnl ) CUDA_ADD_EXECUTABLE( SparseMatrixTest SparseMatrixTest.h SparseMatrixTest.cu OPTIONS ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixTest ${GTEST_BOTH_LIBRARIES} tnl ) ELSE( BUILD_CUDA ) ADD_EXECUTABLE( SparseMatrixCopyTest SparseMatrixCopyTest.h SparseMatrixCopyTest.cpp ) TARGET_COMPILE_OPTIONS( SparseMatrixCopyTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixCopyTest ${GTEST_BOTH_LIBRARIES} tnl ) ADD_EXECUTABLE( SparseMatrixTest SparseMatrixTest.h SparseMatrixTest.cpp ) TARGET_COMPILE_OPTIONS( SparseMatrixTest PRIVATE ${CXX_TESTS_FLAGS} ) TARGET_LINK_LIBRARIES( SparseMatrixTest ${GTEST_BOTH_LIBRARIES} tnl ) ENDIF( BUILD_CUDA ) ADD_TEST( SparseMatrixCopyTest ${EXECUTABLE_OUTPUT_PATH}/SparseMatrixCopyTest${CMAKE_EXECUTABLE_SUFFIX} ) ADD_TEST( SparseMatrixTest ${EXECUTABLE_OUTPUT_PATH}/SparseMatrixTest${CMAKE_EXECUTABLE_SUFFIX} )
src/UnitTests/Matrices/SparseMatrixTest.h +8 −5 Original line number Diff line number Diff line Loading @@ -14,14 +14,17 @@ using CSR_host = TNL::Matrices::CSR< int, TNL::Devices::Host, int >; using CSR_cuda = TNL::Matrices::CSR< int, TNL::Devices::Cuda, int >; using E_host = TNL::Matrices::Ellpack< int, TNL::Devices::Host, int >; using E_cuda = TNL::Matrices::Ellpack< int, TNL::Devices::Cuda, int >; using SE_host = TNL::Matrices::SlicedEllpack< int, TNL::Devices::Host, int, 2 >; using SE_cuda = TNL::Matrices::SlicedEllpack< int, TNL::Devices::Cuda, int, 2 >; #ifdef HAVE_GTEST #include <gtest/gtest.h> //TODO Tests go in here template< typename Matrix > void testGetType() { Matrix<float> matrix; m; matrix.getType(); } #endif Loading