From 171334f2333549b31a87f5f7d7cd457f3b01d516 Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Fri, 13 Dec 2019 10:14:01 -0800 Subject: [PATCH] GEMM unit test: Modify way random values set based on execution space Addressed issue #528 --- unit_test/blas/Test_Blas3_gemm.hpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/unit_test/blas/Test_Blas3_gemm.hpp b/unit_test/blas/Test_Blas3_gemm.hpp index 66ef713e6a..929478d97b 100644 --- a/unit_test/blas/Test_Blas3_gemm.hpp +++ b/unit_test/blas/Test_Blas3_gemm.hpp @@ -106,9 +106,21 @@ namespace Test { Kokkos::Random_XorShift64_Pool rand_pool(seed); // (SA 11 Dec 2019) Max (previously: 10) increased to detect the bug in Trilinos issue #6418 - Kokkos::fill_random(A,rand_pool, Kokkos::rand::generator_type,ScalarA>::max()); - Kokkos::fill_random(B,rand_pool, Kokkos::rand::generator_type,ScalarB>::max()); - Kokkos::fill_random(C,rand_pool, Kokkos::rand::generator_type,ScalarC>::max()); +#ifdef KOKKOS_ENABLE_CUDA + if (std::is_same::value) + { + Kokkos::fill_random(A,rand_pool, Kokkos::rand::generator_type,ScalarA>::max()); + Kokkos::fill_random(B,rand_pool, Kokkos::rand::generator_type,ScalarB>::max()); + Kokkos::fill_random(C,rand_pool, Kokkos::rand::generator_type,ScalarC>::max()); + } + else +#else + { + Kokkos::fill_random(A,rand_pool,ScalarA(10)); + Kokkos::fill_random(B,rand_pool,ScalarB(10)); + Kokkos::fill_random(C,rand_pool,ScalarC(10)); + } +#endif Kokkos::deep_copy(C2,C);