diff --git a/test/grouped_gemm/grouped_gemm_fp16.cpp b/test/grouped_gemm/grouped_gemm_fp16.cpp index b3f7cca418..f20d750d36 100644 --- a/test/grouped_gemm/grouped_gemm_fp16.cpp +++ b/test/grouped_gemm/grouped_gemm_fp16.cpp @@ -2,6 +2,7 @@ // Copyright (c) 2018-2022, Advanced Micro Devices, Inc. All rights reserved. #include +#include #include "profiler/profile_grouped_gemm_impl.hpp" @@ -18,7 +19,10 @@ using Col = ck::tensor_layout::gemm::ColumnMajor; template bool TestGroupedGemm() { - int group_count = rand() % 10 + 1; + + std::mt19937 gen(19391); + std::uniform_int_distribution<> distrib(1, 10); + int group_count = distrib(gen); // GEMM shape std::vector gemm_descs; @@ -29,9 +33,9 @@ bool TestGroupedGemm() for(int i = 0; i < group_count; i++) { - Ms.push_back(256 + 256 * (rand() % 10)); - Ns.push_back(256 + 256 * (rand() % 10)); - Ks.push_back(128 + 128 * (rand() % 10)); + Ms.push_back(256 + 256 * distrib(gen)); + Ns.push_back(256 + 256 * distrib(gen)); + Ks.push_back(128 + 128 * distrib(gen)); StrideAs.push_back(std::is_same::value ? Ks[i] : Ms[i]); StrideBs.push_back(std::is_same::value ? Ns[i] : Ks[i]);