From 4387433acf9cd2eab3713349163cd1e8905b5854 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Wed, 5 Oct 2016 10:42:41 -0700 Subject: [PATCH] Increased the robustness of the reduction tests on fp16 --- unsupported/test/cxx11_tensor_of_float16_cuda.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsupported/test/cxx11_tensor_of_float16_cuda.cu b/unsupported/test/cxx11_tensor_of_float16_cuda.cu index b70c46722..2f86980a2 100644 --- a/unsupported/test/cxx11_tensor_of_float16_cuda.cu +++ b/unsupported/test/cxx11_tensor_of_float16_cuda.cu @@ -339,8 +339,8 @@ void test_cuda_reductions(int size1, int size2, int redux) { Eigen::TensorMap, Eigen::Aligned> gpu_res_float( d_res_float, result_size); - gpu_float1.device(gpu_device) = gpu_float1.random() - 0.5f; - gpu_float2.device(gpu_device) = gpu_float2.random() - 0.5f; + gpu_float1.device(gpu_device) = gpu_float1.random() * 2.0f; + gpu_float2.device(gpu_device) = gpu_float2.random() * 2.0f; Eigen::array redux_dim = {{redux}}; gpu_res_float.device(gpu_device) = gpu_float1.sum(redux_dim).cast();