From 4eb4749ba1270a49188fa9903dc9009e62d8afd0 Mon Sep 17 00:00:00 2001 From: Lukas Cejka <lukas.ostatek@gmail.com> Date: Sun, 11 Nov 2018 22:13:54 +0100 Subject: [PATCH] Fixed vectorProduct test. Updated TODO. --- src/UnitTests/Matrices/SparseMatrixTest.h | 26 +++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/UnitTests/Matrices/SparseMatrixTest.h b/src/UnitTests/Matrices/SparseMatrixTest.h index b5a1e11d8d..b48a9b0154 100644 --- a/src/UnitTests/Matrices/SparseMatrixTest.h +++ b/src/UnitTests/Matrices/SparseMatrixTest.h @@ -503,13 +503,17 @@ void test_VectorProduct() using namespace TNL; using namespace TNL::Containers; using namespace TNL::Containers::Algorithms; + + typedef typename Matrix::RealType RealType; + typedef typename Matrix::DeviceType DeviceType; + typedef typename Matrix::IndexType IndexType; - Vector< int, Devices::Host, int > inVector; + Vector< RealType, DeviceType, IndexType > inVector; inVector.setSize( 4 ); for( int i = 0; i < inVector.getSize(); i++ ) inVector.setElement( i, 2 ); - Vector< int, Devices::Host, int > outVector; + Vector< RealType, DeviceType, IndexType > outVector; outVector.setSize( 5 ); for( int j = 0; j < outVector.getSize(); j++ ) outVector.setElement( j, 0 ); @@ -850,15 +854,15 @@ TEST( SparseMatrixTest, CSR_vectorProductTest_Host ) #ifdef HAVE_CUDA TEST( SparseMatrixTest, CSR_vectorProductTest_Cuda ) { -// test_VectorProduct< CSR_cuda_int >(); - bool testRan = false; - EXPECT_TRUE( testRan ); - std::cout << "\nTEST DID NOT RUN. NOT WORKING.\n\n"; - std::cout << "If launched, this test throws the following message: \n"; - std::cout << " terminate called after throwing an instance of 'TNL::Exceptions::CudaRuntimeError'\n"; - std::cout << " what(): CUDA ERROR 77 (cudaErrorIllegalAddress): an illegal memory access was encountered.\n"; - std::cout << " Source: line 57 in /home/lukas/tnl-dev/src/TNL/Containers/Algorithms/ArrayOperationsCuda_impl.h: an illegal memory access was encountered\n"; - std::cout << " [1] 7238 abort (core dumped) ./SparseMatrixTest-dbg\n\n"; + test_VectorProduct< CSR_cuda_int >(); +// bool testRan = false; +// EXPECT_TRUE( testRan ); +// std::cout << "\nTEST DID NOT RUN. NOT WORKING.\n\n"; +// std::cout << "If launched, this test throws the following message: \n"; +// std::cout << " terminate called after throwing an instance of 'TNL::Exceptions::CudaRuntimeError'\n"; +// std::cout << " what(): CUDA ERROR 77 (cudaErrorIllegalAddress): an illegal memory access was encountered.\n"; +// std::cout << " Source: line 57 in /home/lukas/tnl-dev/src/TNL/Containers/Algorithms/ArrayOperationsCuda_impl.h: an illegal memory access was encountered\n"; +// std::cout << " [1] 7238 abort (core dumped) ./SparseMatrixTest-dbg\n\n"; } #endif -- GitLab