Skip to content
Snippets Groups Projects
Commit 07a68287 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed cross-device comparisons in VectorUnaryOperationsTest

parent 433f27d0
No related branches found
No related tags found
No related merge requests found
...@@ -73,18 +73,19 @@ TYPED_TEST_SUITE( VectorUnaryOperationsTest, VectorTypes ); ...@@ -73,18 +73,19 @@ TYPED_TEST_SUITE( VectorUnaryOperationsTest, VectorTypes );
using VectorOrView = typename TestFixture::VectorOrView; \ using VectorOrView = typename TestFixture::VectorOrView; \
using RealType = typename VectorType::RealType; \ using RealType = typename VectorType::RealType; \
\ \
typename VectorType::HostType _V1h( size ), expected( size ); \ typename VectorType::HostType _V1h( size ), expected_h( size ); \
\ \
const double h = (end - begin) / size; \ const double h = (end - begin) / size; \
for( int i = 0; i < size; i++ ) \ for( int i = 0; i < size; i++ ) \
{ \ { \
const RealType x = begin + i * h; \ const RealType x = begin + i * h; \
_V1h[ i ] = x; \ _V1h[ i ] = x; \
expected[ i ] = function(x); \ expected_h[ i ] = function(x); \
} \ } \
\ \
VectorType _V1; _V1 = _V1h; \ VectorType _V1; _V1 = _V1h; \
VectorOrView V1( _V1 ); \ VectorOrView V1( _V1 ); \
VectorType expected; expected = expected_h; \
TYPED_TEST( VectorUnaryOperationsTest, minus ) TYPED_TEST( VectorUnaryOperationsTest, minus )
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment