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
ca5d706c
There was an error fetching the commit references. Please try again later.
Commit
ca5d706c
authored
6 years ago
by
Lukas Cejka
Browse files
Options
Downloads
Patches
Plain Diff
Adding non-error throwing version of SparseMatrixTest.h
parent
1e159ca3
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
+24
-13
24 additions, 13 deletions
src/UnitTests/Matrices/SparseMatrixTest.h
with
24 additions
and
13 deletions
src/UnitTests/Matrices/SparseMatrixTest.h
+
24
−
13
View file @
ca5d706c
...
...
@@ -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 Matrix
HostFloat, 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, GetTypeTest
Cuda
)
{
testGetType
<
CSR_
cuda
>
();
testGetType< CSR_
host_float, CSR_host_int, CSR_cuda_float, CSR_cuda_int
>();
}
#endif
*/
#endif
#include
"../GtestMissingError.h"
...
...
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