aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-10-05 10:42:41 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-10-05 10:42:41 -0700
commit4387433acf9cd2eab3713349163cd1e8905b5854 (patch)
tree1faae6de3458998b9ad2facb8e36e67634075b1a
parentaad20d700dd12ea69323b7e8777c204ad8399e08 (diff)
Increased the robustness of the reduction tests on fp16
-rw-r--r--unsupported/test/cxx11_tensor_of_float16_cuda.cu4
1 files 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::Tensor<Eigen::half, 1>, 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<int, 1> redux_dim = {{redux}};
gpu_res_float.device(gpu_device) = gpu_float1.sum(redux_dim).cast<Eigen::half>();