From 427ba9156a72fe4e27ae2c78cbaa2e8e0b7145b8 Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Tue, 26 Apr 2022 01:45:17 +0530 Subject: [PATCH] SWDEV-329567 - Fixes timing issu seen on Jenkins rns (#2628) Change-Id: I7b4858033c58cba0c42a8ba8024f9b356e397658 --- tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp b/tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp index cc93e825ba..07a4f7711c 100644 --- a/tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp +++ b/tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp @@ -86,6 +86,7 @@ static inline void hipCheckAndFail(hipError_t errval, do { hipCheckAndFail((errval), __FILE__, __LINE__); } while (0) __global__ void test_kernel(uint32_t loops, unsigned long long *array, long long totalTicks) { + cooperative_groups::thread_block tb = cooperative_groups::this_thread_block(); unsigned int rank = blockIdx.x * blockDim.x + threadIdx.x; for (int i = 0; i < loops; i++) { @@ -100,6 +101,7 @@ __global__ void test_kernel(uint32_t loops, unsigned long long *array, long long // So just ignore those slipped cycles. last_clock = cur_clock; } while(time_diff < totalTicks); + tb.sync(); array[rank] += clock64(); } }