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
dba76c88
There was an error fetching the commit references. Please try again later.
Commit
dba76c88
authored
5 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Fixed segfault in VectorUnaryOperationsTest
parent
2ef3ae9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/UnitTests/Containers/VectorUnaryOperationsTest.h
+8
-2
8 additions, 2 deletions
src/UnitTests/Containers/VectorUnaryOperationsTest.h
with
8 additions
and
2 deletions
src/UnitTests/Containers/VectorUnaryOperationsTest.h
+
8
−
2
View file @
dba76c88
...
...
@@ -94,14 +94,20 @@ TYPED_TEST_SUITE( VectorUnaryOperationsTest, VectorTypes );
// - GPU may have different precision than CPU, so exact comparison with
// the result from host is not possible
template
<
typename
Left
,
typename
Right
>
void
expect_vectors_near
(
const
Left
&
v1
,
const
Right
&
v2
)
void
expect_vectors_near
(
const
Left
&
_
v1
,
const
Right
&
_
v2
)
{
ASSERT_EQ
(
v1
.
getSize
(),
v2
.
getSize
()
);
ASSERT_EQ
(
_
v1
.
getSize
(),
_
v2
.
getSize
()
);
using
LeftNonConstReal
=
std
::
remove_const_t
<
typename
Left
::
RealType
>
;
using
RightNonConstReal
=
std
::
remove_const_t
<
typename
Right
::
RealType
>
;
using
LeftVector
=
Vector
<
LeftNonConstReal
,
typename
Left
::
DeviceType
,
typename
Left
::
IndexType
>
;
using
RightVector
=
Vector
<
RightNonConstReal
,
typename
Right
::
DeviceType
,
typename
Right
::
IndexType
>
;
using
LeftHostVector
=
Vector
<
LeftNonConstReal
,
Devices
::
Host
,
typename
Left
::
IndexType
>
;
using
RightHostVector
=
Vector
<
RightNonConstReal
,
Devices
::
Host
,
typename
Right
::
IndexType
>
;
// first evaluate expressions
LeftVector
v1
;
v1
=
_v1
;
RightVector
v2
;
v2
=
_v2
;
// then copy to host
LeftHostVector
v1_h
;
v1_h
=
v1
;
RightHostVector
v2_h
;
v2_h
=
v1
;
for
(
int
i
=
0
;
i
<
v1
.
getSize
();
i
++
)
...
...
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