Skip to content
Snippets Groups Projects
Commit ca5d706c authored by Lukas Cejka's avatar Lukas Cejka
Browse files

Adding non-error throwing version of SparseMatrixTest.h

parent 1e159ca3
No related branches found
No related tags found
1 merge request!16Matrices
......@@ -12,34 +12,45 @@
#include <TNL/Matrices/Ellpack.h>
#include <TNL/Matrices/SlicedEllpack.h>
using CSR_host = TNL::Matrices::CSR< int, TNL::Devices::Host, int >;
using CSR_cuda = TNL::Matrices::CSR< int, TNL::Devices::Cuda, int >;
using CSR_host_float = TNL::Matrices::CSR< float, TNL::Devices::Host, int >;
using CSR_host_int = TNL::Matrices::CSR< int, TNL::Devices::Host, int >;
using CSR_cuda_float = TNL::Matrices::CSR< float, TNL::Devices::Cuda, int >;
using CSR_cuda_int = TNL::Matrices::CSR< int, TNL::Devices::Cuda, int >;
#ifdef HAVE_GTEST
#include <gtest/gtest.h>
/*
template< typename Matrix >
template< typename MatrixHostFloat, typename MatrixHostInt, typename MatrixCudaFloat, typename MatrixCudaInt >
void testGetType()
{
Matrix<float, TNL::Devices::Cuda, int> floatCudaMatrix;
// using CSR_host_getType = TNL::Matrices::CSR< float, TNL::Devices::Host, int>
Matrix<float, TNL::Devices::Host, int> floatHostMatrix;
// using CSR_cuda_getType = TNL::Matrices::CSR< float, TNL::Devices::Cuda, int>
EXPECT_STREQ( floatCudaMatrix.getType(), "Matrices::CSR< float, Cuda >");
MatrixHostFloat mtrxHostFloat;
MatrixHostInt mtrxHostInt;
MatrixCudaFloat mtrxCudaFloat;
MatrixCudaInt mtrxCudaInt;
//string str = "Matrices::CSR< float, Devices::Host >";
EXPECT_STREQ( mtrxHostFloat.getType(), String("Matrices::CSR< float, Devices::Host >") );
EXPECT_STREQ( mtrxHostInt.getType(), String("Matrices::CSR< int, Devices::Host >") );
EXPECT_STREQ( mtrxCudaFloat.getType(), "Matrices::CSR< float, Cuda >" );
EXPECT_STREQ( mtrxCudaInt.getType(), "Matrices::CSR< int, Cuda >" );
}
TEST( SparseMatrixTest, GetTypeTest )
TEST( SparseMatrixTest, CSR_GetTypeTest )
{
testGetType< CSR_host >();
testGetType< CSR_host_float, CSR_host_int, CSR_cuda_float, CSR_cuda_int >();
}
#ifdef HAVE_CUDA
TEST( SparseMatrixTest, GetTypeTest )
TEST( SparseMatrixTest, GetTypeTestCuda )
{
testGetType< CSR_cuda >();
testGetType< CSR_host_float, CSR_host_int, CSR_cuda_float, CSR_cuda_int >();
}
#endif
*/
#endif
#include "../GtestMissingError.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