Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
8740dfac
There was an error fetching the commit references. Please try again later.
Commit
8740dfac
authored
6 years ago
by
Lukas Cejka
Committed by
Tomáš Oberhuber
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixed setDimension, setLike, reset tests.
parent
25467ffc
No related branches found
No related tags found
1 merge request
!45
Matrices revision
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/UnitTests/Matrices/SparseMatrixTest_AdEllpack.h
+21
-15
21 additions, 15 deletions
src/UnitTests/Matrices/SparseMatrixTest_AdEllpack.h
src/UnitTests/Matrices/SparseMatrixTest_BiEllpack.h
+36
-30
36 additions, 30 deletions
src/UnitTests/Matrices/SparseMatrixTest_BiEllpack.h
with
57 additions
and
45 deletions
src/UnitTests/Matrices/SparseMatrixTest_AdEllpack.h
+
21
−
15
View file @
8740dfac
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
#ifdef HAVE_GTEST
#ifdef HAVE_GTEST
#include
<gtest/gtest.h>
#include
<gtest/gtest.h>
#ifdef NOT_WORKING
// test fixture for typed tests
// test fixture for typed tests
template
<
typename
Matrix
>
template
<
typename
Matrix
>
class
AdEllpackMatrixTest
:
public
::
testing
::
Test
class
AdEllpackMatrixTest
:
public
::
testing
::
Test
...
@@ -58,6 +57,7 @@ using AdEllpackMatrixTypes = ::testing::Types
...
@@ -58,6 +57,7 @@ using AdEllpackMatrixTypes = ::testing::Types
TYPED_TEST_SUITE
(
AdEllpackMatrixTest
,
AdEllpackMatrixTypes
);
TYPED_TEST_SUITE
(
AdEllpackMatrixTest
,
AdEllpackMatrixTypes
);
// WORKING
TYPED_TEST
(
AdEllpackMatrixTest
,
setDimensionsTest
)
TYPED_TEST
(
AdEllpackMatrixTest
,
setDimensionsTest
)
{
{
using
AdEllpackMatrixType
=
typename
TestFixture
::
AdEllpackMatrixType
;
using
AdEllpackMatrixType
=
typename
TestFixture
::
AdEllpackMatrixType
;
...
@@ -65,20 +65,21 @@ TYPED_TEST( AdEllpackMatrixTest, setDimensionsTest )
...
@@ -65,20 +65,21 @@ TYPED_TEST( AdEllpackMatrixTest, setDimensionsTest )
test_SetDimensions
<
AdEllpackMatrixType
>
();
test_SetDimensions
<
AdEllpackMatrixType
>
();
}
}
TYPED_TEST
(
AdEllpackMatrixTest
,
setCompressedRowLengthsTest
)
//TYPED_TEST( AdEllpackMatrixTest, setCompressedRowLengthsTest )
{
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_SetCompressedRowLengths< AdEllpackMatrixType >();
//// test_SetCompressedRowLengths< AdEllpackMatrixType >();
//
bool
testRan
=
false
;
// bool testRan = false;
EXPECT_TRUE
(
testRan
);
// EXPECT_TRUE( testRan );
std
::
cout
<<
"
\n
TEST DID NOT RUN. NOT WORKING.
\n\n
"
;
// std::cout << "\nTEST DID NOT RUN. NOT WORKING.\n\n";
std
::
cout
<<
" This test is dependent on the input format.
\n
"
;
// std::cout << " This test is dependent on the input format. \n";
std
::
cout
<<
" Almost every format allocates elements per row differently.
\n\n
"
;
// std::cout << " Almost every format allocates elements per row differently.\n\n";
std
::
cout
<<
"
\n
TODO: Finish implementation of getNonZeroRowLength (Only non-zero elements, not the number of allocated elements.)
\n\n
"
;
// std::cout << "\n TODO: Finish implementation of getNonZeroRowLength (Only non-zero elements, not the number of allocated elements.)\n\n";
}
//}
// WORKING
TYPED_TEST
(
AdEllpackMatrixTest
,
setLikeTest
)
TYPED_TEST
(
AdEllpackMatrixTest
,
setLikeTest
)
{
{
using
AdEllpackMatrixType
=
typename
TestFixture
::
AdEllpackMatrixType
;
using
AdEllpackMatrixType
=
typename
TestFixture
::
AdEllpackMatrixType
;
...
@@ -86,6 +87,7 @@ TYPED_TEST( AdEllpackMatrixTest, setLikeTest )
...
@@ -86,6 +87,7 @@ TYPED_TEST( AdEllpackMatrixTest, setLikeTest )
test_SetLike
<
AdEllpackMatrixType
,
AdEllpackMatrixType
>
();
test_SetLike
<
AdEllpackMatrixType
,
AdEllpackMatrixType
>
();
}
}
// WORKING
TYPED_TEST
(
AdEllpackMatrixTest
,
resetTest
)
TYPED_TEST
(
AdEllpackMatrixTest
,
resetTest
)
{
{
using
AdEllpackMatrixType
=
typename
TestFixture
::
AdEllpackMatrixType
;
using
AdEllpackMatrixType
=
typename
TestFixture
::
AdEllpackMatrixType
;
...
@@ -93,8 +95,12 @@ TYPED_TEST( AdEllpackMatrixTest, resetTest )
...
@@ -93,8 +95,12 @@ TYPED_TEST( AdEllpackMatrixTest, resetTest )
test_Reset
<
AdEllpackMatrixType
>
();
test_Reset
<
AdEllpackMatrixType
>
();
}
}
#ifdef NOT_WORKING
TYPED_TEST
(
AdEllpackMatrixTest
,
setElementTest
)
TYPED_TEST
(
AdEllpackMatrixTest
,
setElementTest
)
{
{
// This test fails on m.setCompressedRowLengths( rowLengths ) in SparseMatrixTest.hpp
using
AdEllpackMatrixType
=
typename
TestFixture
::
AdEllpackMatrixType
;
using
AdEllpackMatrixType
=
typename
TestFixture
::
AdEllpackMatrixType
;
test_SetElement
<
AdEllpackMatrixType
>
();
test_SetElement
<
AdEllpackMatrixType
>
();
...
...
This diff is collapsed.
Click to expand it.
src/UnitTests/Matrices/SparseMatrixTest_BiEllpack.h
+
36
−
30
View file @
8740dfac
...
@@ -16,7 +16,6 @@
...
@@ -16,7 +16,6 @@
#ifdef HAVE_GTEST
#ifdef HAVE_GTEST
#include
<gtest/gtest.h>
#include
<gtest/gtest.h>
#ifdef NOT_WORKING
// test fixture for typed tests
// test fixture for typed tests
template
<
typename
Matrix
>
template
<
typename
Matrix
>
class
BiEllpackMatrixTest
:
public
::
testing
::
Test
class
BiEllpackMatrixTest
:
public
::
testing
::
Test
...
@@ -39,25 +38,26 @@ using BiEllpackMatrixTypes = ::testing::Types
...
@@ -39,25 +38,26 @@ using BiEllpackMatrixTypes = ::testing::Types
TNL
::
Matrices
::
BiEllpack
<
int
,
TNL
::
Devices
::
Host
,
long
>
,
TNL
::
Matrices
::
BiEllpack
<
int
,
TNL
::
Devices
::
Host
,
long
>
,
TNL
::
Matrices
::
BiEllpack
<
long
,
TNL
::
Devices
::
Host
,
long
>
,
TNL
::
Matrices
::
BiEllpack
<
long
,
TNL
::
Devices
::
Host
,
long
>
,
TNL
::
Matrices
::
BiEllpack
<
float
,
TNL
::
Devices
::
Host
,
long
>
,
TNL
::
Matrices
::
BiEllpack
<
float
,
TNL
::
Devices
::
Host
,
long
>
,
TNL
::
Matrices
::
BiEllpack
<
double
,
TNL
::
Devices
::
Host
,
long
>
//
,
TNL
::
Matrices
::
BiEllpack
<
double
,
TNL
::
Devices
::
Host
,
long
>
,
//
#ifdef HAVE_CUDA
#ifdef HAVE_CUDA
//
TNL::Matrices::BiEllpack< int, TNL::Devices::Cuda, short >,
TNL
::
Matrices
::
BiEllpack
<
int
,
TNL
::
Devices
::
Cuda
,
short
>
,
//
TNL::Matrices::BiEllpack< long, TNL::Devices::Cuda, short >,
TNL
::
Matrices
::
BiEllpack
<
long
,
TNL
::
Devices
::
Cuda
,
short
>
,
//
TNL::Matrices::BiEllpack< float, TNL::Devices::Cuda, short >,
TNL
::
Matrices
::
BiEllpack
<
float
,
TNL
::
Devices
::
Cuda
,
short
>
,
//
TNL::Matrices::BiEllpack< double, TNL::Devices::Cuda, short >,
TNL
::
Matrices
::
BiEllpack
<
double
,
TNL
::
Devices
::
Cuda
,
short
>
,
//
TNL::Matrices::BiEllpack< int, TNL::Devices::Cuda, int >,
TNL
::
Matrices
::
BiEllpack
<
int
,
TNL
::
Devices
::
Cuda
,
int
>
,
//
TNL::Matrices::BiEllpack< long, TNL::Devices::Cuda, int >,
TNL
::
Matrices
::
BiEllpack
<
long
,
TNL
::
Devices
::
Cuda
,
int
>
,
//
TNL::Matrices::BiEllpack< float, TNL::Devices::Cuda, int >,
TNL
::
Matrices
::
BiEllpack
<
float
,
TNL
::
Devices
::
Cuda
,
int
>
,
//
TNL::Matrices::BiEllpack< double, TNL::Devices::Cuda, int >,
TNL
::
Matrices
::
BiEllpack
<
double
,
TNL
::
Devices
::
Cuda
,
int
>
,
//
TNL::Matrices::BiEllpack< int, TNL::Devices::Cuda, long >,
TNL
::
Matrices
::
BiEllpack
<
int
,
TNL
::
Devices
::
Cuda
,
long
>
,
//
TNL::Matrices::BiEllpack< long, TNL::Devices::Cuda, long >,
TNL
::
Matrices
::
BiEllpack
<
long
,
TNL
::
Devices
::
Cuda
,
long
>
,
//
TNL::Matrices::BiEllpack< float, TNL::Devices::Cuda, long >,
TNL
::
Matrices
::
BiEllpack
<
float
,
TNL
::
Devices
::
Cuda
,
long
>
,
//
TNL::Matrices::BiEllpack< double, TNL::Devices::Cuda, long >
TNL
::
Matrices
::
BiEllpack
<
double
,
TNL
::
Devices
::
Cuda
,
long
>
//
#endif
#endif
>
;
>
;
TYPED_TEST_SUITE
(
BiEllpackMatrixTest
,
BiEllpackMatrixTypes
);
TYPED_TEST_SUITE
(
BiEllpackMatrixTest
,
BiEllpackMatrixTypes
);
// WORKING
TYPED_TEST
(
BiEllpackMatrixTest
,
setDimensionsTest
)
TYPED_TEST
(
BiEllpackMatrixTest
,
setDimensionsTest
)
{
{
using
BiEllpackMatrixType
=
typename
TestFixture
::
BiEllpackMatrixType
;
using
BiEllpackMatrixType
=
typename
TestFixture
::
BiEllpackMatrixType
;
...
@@ -65,20 +65,21 @@ TYPED_TEST( BiEllpackMatrixTest, setDimensionsTest )
...
@@ -65,20 +65,21 @@ TYPED_TEST( BiEllpackMatrixTest, setDimensionsTest )
test_SetDimensions
<
BiEllpackMatrixType
>
();
test_SetDimensions
<
BiEllpackMatrixType
>
();
}
}
TYPED_TEST
(
BiEllpackMatrixTest
,
setCompressedRowLengthsTest
)
//TYPED_TEST( BiEllpackMatrixTest, setCompressedRowLengthsTest )
{
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_SetCompressedRowLengths< BiEllpackMatrixType >();
//// test_SetCompressedRowLengths< BiEllpackMatrixType >();
//
bool
testRan
=
false
;
// bool testRan = false;
EXPECT_TRUE
(
testRan
);
// EXPECT_TRUE( testRan );
std
::
cout
<<
"
\n
TEST DID NOT RUN. NOT WORKING.
\n\n
"
;
// std::cout << "\nTEST DID NOT RUN. NOT WORKING.\n\n";
std
::
cout
<<
" This test is dependent on the input format.
\n
"
;
// std::cout << " This test is dependent on the input format. \n";
std
::
cout
<<
" Almost every format allocates elements per row differently.
\n\n
"
;
// std::cout << " Almost every format allocates elements per row differently.\n\n";
std
::
cout
<<
"
\n
TODO: Finish implementation of getNonZeroRowLength (Only non-zero elements, not the number of allocated elements.)
\n\n
"
;
// std::cout << "\n TODO: Finish implementation of getNonZeroRowLength (Only non-zero elements, not the number of allocated elements.)\n\n";
}
//}
// WORKING
TYPED_TEST
(
BiEllpackMatrixTest
,
setLikeTest
)
TYPED_TEST
(
BiEllpackMatrixTest
,
setLikeTest
)
{
{
using
BiEllpackMatrixType
=
typename
TestFixture
::
BiEllpackMatrixType
;
using
BiEllpackMatrixType
=
typename
TestFixture
::
BiEllpackMatrixType
;
...
@@ -86,6 +87,7 @@ TYPED_TEST( BiEllpackMatrixTest, setLikeTest )
...
@@ -86,6 +87,7 @@ TYPED_TEST( BiEllpackMatrixTest, setLikeTest )
test_SetLike
<
BiEllpackMatrixType
,
BiEllpackMatrixType
>
();
test_SetLike
<
BiEllpackMatrixType
,
BiEllpackMatrixType
>
();
}
}
// WORKING
TYPED_TEST
(
BiEllpackMatrixTest
,
resetTest
)
TYPED_TEST
(
BiEllpackMatrixTest
,
resetTest
)
{
{
using
BiEllpackMatrixType
=
typename
TestFixture
::
BiEllpackMatrixType
;
using
BiEllpackMatrixType
=
typename
TestFixture
::
BiEllpackMatrixType
;
...
@@ -93,8 +95,12 @@ TYPED_TEST( BiEllpackMatrixTest, resetTest )
...
@@ -93,8 +95,12 @@ TYPED_TEST( BiEllpackMatrixTest, resetTest )
test_Reset
<
BiEllpackMatrixType
>
();
test_Reset
<
BiEllpackMatrixType
>
();
}
}
#ifdef NOT_WORKING
TYPED_TEST
(
BiEllpackMatrixTest
,
setElementTest
)
TYPED_TEST
(
BiEllpackMatrixTest
,
setElementTest
)
{
{
// This test will segfault in the first test where Device is Cuda.
// This test doesn't return the correct values.
using
BiEllpackMatrixType
=
typename
TestFixture
::
BiEllpackMatrixType
;
using
BiEllpackMatrixType
=
typename
TestFixture
::
BiEllpackMatrixType
;
test_SetElement
<
BiEllpackMatrixType
>
();
test_SetElement
<
BiEllpackMatrixType
>
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment