From b635982e4b325fdf8721db141eb6cc0631898680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Oberhuber?= <oberhuber.tomas@gmail.com> Date: Tue, 16 Jul 2019 10:08:48 +0200 Subject: [PATCH] Fixed vector setup on host in VectorTest-1. --- src/UnitTests/Containers/VectorTest-1.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/UnitTests/Containers/VectorTest-1.h b/src/UnitTests/Containers/VectorTest-1.h index 3b01d60ec0..e12ed8ad6d 100644 --- a/src/UnitTests/Containers/VectorTest-1.h +++ b/src/UnitTests/Containers/VectorTest-1.h @@ -174,11 +174,14 @@ TYPED_TEST( VectorTest, addVector ) y.setSize( size ); ViewType x_view( x ), y_view( y ); - VectorType expected1( size ), expected2( size ); + typename VectorType::HostType host_expected1( size ), host_expected2( size ); for( int i = 0; i < size; i++ ) { - expected1.setElement( i, 2.0 + 3.0 * i ); - expected2.setElement( i, 1.0 + 3.0 * i ); + host_expected1.setElement( i, 2.0 + 3.0 * i ); + host_expected2.setElement( i, 1.0 + 3.0 * i ); } + VectorType expected1, expected2; + expected1 = host_expected1; + expected2 = host_expected2; setConstantSequence( x, 1 ); setLinearSequence( y ); @@ -222,11 +225,14 @@ TYPED_TEST( VectorTest, addVectors ) z.setSize( size ); ViewType x_view( x ), y_view( y ), z_view( z ); - VectorType expected1( size ), expected2( size ); + typename VectorType::HostType host_expected1( size ), host_expected2( size ); for( int i = 0; i < size; i++ ) { - expected1.setElement( i, 1.0 + 3.0 * i + 2.0 ); - expected2.setElement( i, 2.0 + 3.0 * i + 2.0 ); + host_expected1.setElement( i, 1.0 + 3.0 * i + 2.0 ); + host_expected2.setElement( i, 2.0 + 3.0 * i + 2.0 ); } + VectorType expected1, expected2; + expected1 = host_expected1; + expected2 = host_expected2; setConstantSequence( x, 1 ); setLinearSequence( y ); -- GitLab