Skip to content

Commit

Permalink
GEMM unit test: Modify way random values set based on execution space
Browse files Browse the repository at this point in the history
Addressed issue #528
  • Loading branch information
ndellingwood committed Dec 13, 2019
1 parent 4cd9627 commit 171334f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions unit_test/blas/Test_Blas3_gemm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,21 @@ namespace Test {
Kokkos::Random_XorShift64_Pool<execution_space> 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<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarA>::max());
Kokkos::fill_random(B,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarB>::max());
Kokkos::fill_random(C,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarC>::max());
#ifdef KOKKOS_ENABLE_CUDA
if (std::is_same<execution_space,Kokkos::Cuda>::value)
{
Kokkos::fill_random(A,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarA>::max());
Kokkos::fill_random(B,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::generator_type,ScalarB>::max());
Kokkos::fill_random(C,rand_pool, Kokkos::rand<typename Kokkos::Random_XorShift64_Pool<execution_space>::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);

Expand Down

0 comments on commit 171334f

Please sign in to comment.