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
b2f675d3
There was an error fetching the commit references. Please try again later.
Commit
b2f675d3
authored
6 years ago
by
Lukas Cejka
Browse files
Options
Downloads
Patches
Plain Diff
Added provisional tests for AdEllpack and BiEllpack.
parent
c966edf6
No related branches found
No related tags found
1 merge request
!16
Matrices
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/UnitTests/Matrices/SparseMatrixTest.h
+256
-34
256 additions, 34 deletions
src/UnitTests/Matrices/SparseMatrixTest.h
with
256 additions
and
34 deletions
src/UnitTests/Matrices/SparseMatrixTest.h
+
256
−
34
View file @
b2f675d3
...
...
@@ -844,16 +844,238 @@ void test_Print()
EXPECT_EQ
(
printed
.
str
(),
couted
.
str
()
);
}
//// test fixture for typed tests
//template< typename Matrix >
//class AdEllpackMatrixTest : public ::testing::Test
//{
//protected:
// using AdEllpackMatrixType = Matrix;
//};
//
//// types for which MatrixTest is instantiated
//using AdEllpackMatrixTypes = ::testing::Types
//<
// TNL::Matrices::AdEllpack< int, TNL::Devices::Host, short >,
// TNL::Matrices::AdEllpack< long, TNL::Devices::Host, short >,
// TNL::Matrices::AdEllpack< float, TNL::Devices::Host, short >,
// TNL::Matrices::AdEllpack< double, TNL::Devices::Host, short >,
// TNL::Matrices::AdEllpack< int, TNL::Devices::Host, int >,
// TNL::Matrices::AdEllpack< long, TNL::Devices::Host, int >,
// TNL::Matrices::AdEllpack< float, TNL::Devices::Host, int >,
// TNL::Matrices::AdEllpack< double, TNL::Devices::Host, int >,
// TNL::Matrices::AdEllpack< int, TNL::Devices::Host, long >,
// TNL::Matrices::AdEllpack< long, TNL::Devices::Host, long >,
// TNL::Matrices::AdEllpack< float, TNL::Devices::Host, long >,
// TNL::Matrices::AdEllpack< double, TNL::Devices::Host, long >,
//#ifdef HAVE_CUDA
// TNL::Matrices::AdEllpack< int, TNL::Devices::Cuda, short >,
// TNL::Matrices::AdEllpack< long, TNL::Devices::Cuda, short >,
// TNL::Matrices::AdEllpack< float, TNL::Devices::Cuda, short >,
// TNL::Matrices::AdEllpack< double, TNL::Devices::Cuda, short >,
// TNL::Matrices::AdEllpack< int, TNL::Devices::Cuda, int >,
// TNL::Matrices::AdEllpack< long, TNL::Devices::Cuda, int >,
// TNL::Matrices::AdEllpack< float, TNL::Devices::Cuda, int >,
// TNL::Matrices::AdEllpack< double, TNL::Devices::Cuda, int >,
// TNL::Matrices::AdEllpack< int, TNL::Devices::Cuda, long >,
// TNL::Matrices::AdEllpack< long, TNL::Devices::Cuda, long >,
// TNL::Matrices::AdEllpack< float, TNL::Devices::Cuda, long >,
// TNL::Matrices::AdEllpack< double, TNL::Devices::Cuda, long >
//#endif
//>;
//
//TYPED_TEST_CASE( AdEllpackMatrixTest, AdEllpackMatrixTypes);
//
//TYPED_TEST( AdEllpackMatrixTest, setDimensionsTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_SetDimensions< AdEllpackMatrixType >();
//}
//
//TYPED_TEST( AdEllpackMatrixTest, setCompressedRowLengthsTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_SetCompressedRowLengths< AdEllpackMatrixType >();
//}
//
//TYPED_TEST( AdEllpackMatrixTest, setLikeTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_SetLike< AdEllpackMatrixType, AdEllpackMatrixType >();
//}
//
//TYPED_TEST( AdEllpackMatrixTest, resetTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_Reset< AdEllpackMatrixType >();
//}
//
//TYPED_TEST( AdEllpackMatrixTest, setElementTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_SetElement< AdEllpackMatrixType >();
//}
//
//TYPED_TEST( AdEllpackMatrixTest, addElementTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_AddElement< AdEllpackMatrixType >();
//}
//
//TYPED_TEST( AdEllpackMatrixTest, setRowTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_SetRow< AdEllpackMatrixType >();
//}
//
//TYPED_TEST( AdEllpackMatrixTest, vectorProductTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_VectorProduct< AdEllpackMatrixType >();
//}
//
//TYPED_TEST( AdEllpackMatrixTest, saveAndLoadTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_SaveAndLoad< AdEllpackMatrixType >();
//}
//
//TYPED_TEST( AdEllpackMatrixTest, printTest )
//{
// using AdEllpackMatrixType = typename TestFixture::AdEllpackMatrixType;
//
// test_Print< AdEllpackMatrixType >();
//}
//
//// test fixture for typed tests
//template< typename Matrix >
//class BiEllpackMatrixTest : public ::testing::Test
//{
//protected:
// using BiEllpackMatrixType = Matrix;
//};
//
//// types for which MatrixTest is instantiated
//using BiEllpackMatrixTypes = ::testing::Types
//<
// TNL::Matrices::BiEllpack< int, TNL::Devices::Host, short >,
// TNL::Matrices::BiEllpack< long, TNL::Devices::Host, short >,
// TNL::Matrices::BiEllpack< float, TNL::Devices::Host, short >,
// TNL::Matrices::BiEllpack< double, TNL::Devices::Host, short >,
// TNL::Matrices::BiEllpack< int, TNL::Devices::Host, int >,
// TNL::Matrices::BiEllpack< long, TNL::Devices::Host, int >,
// TNL::Matrices::BiEllpack< float, TNL::Devices::Host, int >,
// TNL::Matrices::BiEllpack< double, TNL::Devices::Host, int >,
// TNL::Matrices::BiEllpack< int, TNL::Devices::Host, long >,
// TNL::Matrices::BiEllpack< long, TNL::Devices::Host, long >,
// TNL::Matrices::BiEllpack< float, TNL::Devices::Host, long >,
// TNL::Matrices::BiEllpack< double, TNL::Devices::Host, long >//,
////#ifdef HAVE_CUDA
//// TNL::Matrices::BiEllpack< int, TNL::Devices::Cuda, short >,
//// TNL::Matrices::BiEllpack< long, TNL::Devices::Cuda, short >,
//// TNL::Matrices::BiEllpack< float, TNL::Devices::Cuda, short >,
//// TNL::Matrices::BiEllpack< double, TNL::Devices::Cuda, short >,
//// TNL::Matrices::BiEllpack< int, TNL::Devices::Cuda, int >,
//// TNL::Matrices::BiEllpack< long, TNL::Devices::Cuda, int >,
//// TNL::Matrices::BiEllpack< float, TNL::Devices::Cuda, int >,
//// TNL::Matrices::BiEllpack< double, TNL::Devices::Cuda, int >,
//// TNL::Matrices::BiEllpack< int, TNL::Devices::Cuda, long >,
//// TNL::Matrices::BiEllpack< long, TNL::Devices::Cuda, long >,
//// TNL::Matrices::BiEllpack< float, TNL::Devices::Cuda, long >,
//// TNL::Matrices::BiEllpack< double, TNL::Devices::Cuda, long >
////#endif
//>;
//
//TYPED_TEST_CASE( BiEllpackMatrixTest, BiEllpackMatrixTypes);
//
//TYPED_TEST( BiEllpackMatrixTest, setDimensionsTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_SetDimensions< BiEllpackMatrixType >();
//}
//
//TYPED_TEST( BiEllpackMatrixTest, setCompressedRowLengthsTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_SetCompressedRowLengths< BiEllpackMatrixType >();
//}
//
//TYPED_TEST( BiEllpackMatrixTest, setLikeTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_SetLike< BiEllpackMatrixType, BiEllpackMatrixType >();
//}
//
//TYPED_TEST( BiEllpackMatrixTest, resetTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_Reset< BiEllpackMatrixType >();
//}
//
//TYPED_TEST( BiEllpackMatrixTest, setElementTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_SetElement< BiEllpackMatrixType >();
//}
//
//TYPED_TEST( BiEllpackMatrixTest, addElementTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_AddElement< BiEllpackMatrixType >();
//}
//
//TYPED_TEST( BiEllpackMatrixTest, setRowTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_SetRow< BiEllpackMatrixType >();
//}
//
//TYPED_TEST( BiEllpackMatrixTest, vectorProductTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_VectorProduct< BiEllpackMatrixType >();
//}
//
//TYPED_TEST( BiEllpackMatrixTest, saveAndLoadTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_SaveAndLoad< BiEllpackMatrixType >();
//}
//
//TYPED_TEST( BiEllpackMatrixTest, printTest )
//{
// using BiEllpackMatrixType = typename TestFixture::BiEllpackMatrixType;
//
// test_Print< BiEllpackMatrixType >();
//}
// test fixture for typed tests
template
<
typename
Matrix
>
class
C
H
EllpackMatrixTest
:
public
::
testing
::
Test
class
C
h
EllpackMatrixTest
:
public
::
testing
::
Test
{
protected:
using
C
H
EllpackMatrixType
=
Matrix
;
using
C
h
EllpackMatrixType
=
Matrix
;
};
// types for which MatrixTest is instantiated
using
C
H
EllpackMatrixTypes
=
::
testing
::
Types
using
C
h
EllpackMatrixTypes
=
::
testing
::
Types
<
TNL
::
Matrices
::
ChunkedEllpack
<
int
,
TNL
::
Devices
::
Host
,
short
>
,
TNL
::
Matrices
::
ChunkedEllpack
<
long
,
TNL
::
Devices
::
Host
,
short
>
,
...
...
@@ -883,76 +1105,76 @@ using CHEllpackMatrixTypes = ::testing::Types
#endif
>
;
TYPED_TEST_CASE
(
C
H
EllpackMatrixTest
,
C
H
EllpackMatrixTypes
);
TYPED_TEST_CASE
(
C
h
EllpackMatrixTest
,
C
h
EllpackMatrixTypes
);
TYPED_TEST
(
C
H
EllpackMatrixTest
,
setDimensionsTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
setDimensionsTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_SetDimensions
<
C
H
EllpackMatrixType
>
();
test_SetDimensions
<
C
h
EllpackMatrixType
>
();
}
TYPED_TEST
(
C
H
EllpackMatrixTest
,
setCompressedRowLengthsTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
setCompressedRowLengthsTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_SetCompressedRowLengths
<
C
H
EllpackMatrixType
>
();
test_SetCompressedRowLengths
<
C
h
EllpackMatrixType
>
();
}
TYPED_TEST
(
C
H
EllpackMatrixTest
,
setLikeTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
setLikeTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_SetLike
<
C
H
EllpackMatrixType
,
C
H
EllpackMatrixType
>
();
test_SetLike
<
C
h
EllpackMatrixType
,
C
h
EllpackMatrixType
>
();
}
TYPED_TEST
(
C
H
EllpackMatrixTest
,
resetTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
resetTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_Reset
<
C
H
EllpackMatrixType
>
();
test_Reset
<
C
h
EllpackMatrixType
>
();
}
TYPED_TEST
(
C
H
EllpackMatrixTest
,
setElementTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
setElementTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_SetElement
<
C
H
EllpackMatrixType
>
();
test_SetElement
<
C
h
EllpackMatrixType
>
();
}
TYPED_TEST
(
C
H
EllpackMatrixTest
,
addElementTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
addElementTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_AddElement
<
C
H
EllpackMatrixType
>
();
test_AddElement
<
C
h
EllpackMatrixType
>
();
}
TYPED_TEST
(
C
H
EllpackMatrixTest
,
setRowTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
setRowTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_SetRow
<
C
H
EllpackMatrixType
>
();
test_SetRow
<
C
h
EllpackMatrixType
>
();
}
TYPED_TEST
(
C
H
EllpackMatrixTest
,
vectorProductTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
vectorProductTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_VectorProduct
<
C
H
EllpackMatrixType
>
();
test_VectorProduct
<
C
h
EllpackMatrixType
>
();
}
TYPED_TEST
(
C
H
EllpackMatrixTest
,
saveAndLoadTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
saveAndLoadTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_SaveAndLoad
<
C
H
EllpackMatrixType
>
();
test_SaveAndLoad
<
C
h
EllpackMatrixType
>
();
}
TYPED_TEST
(
C
H
EllpackMatrixTest
,
printTest
)
TYPED_TEST
(
C
h
EllpackMatrixTest
,
printTest
)
{
using
C
H
EllpackMatrixType
=
typename
TestFixture
::
C
H
EllpackMatrixType
;
using
C
h
EllpackMatrixType
=
typename
TestFixture
::
C
h
EllpackMatrixType
;
test_Print
<
C
H
EllpackMatrixType
>
();
test_Print
<
C
h
EllpackMatrixType
>
();
}
// test fixture for typed tests
...
...
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