From 41acbf98be9ae0db675b46065d00950ef3e6de6c Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Tue, 1 Nov 2022 06:08:26 +0530 Subject: [PATCH] SWDEV-360437 - fix tests with hipGetLastError() (#3040) Unit_hipFreeImplicitSyncDev* Unit_hipFreeImplicitSyncHost* Unit_hipFreeImplicitSyncArray* Unit_hipStreamCreateWithFlags_DefaultStreamInteraction Unit_hipStreamSynchronize_NullStreamAndStreamPerThread Change-Id: I382cf13bfe15bd8b1af657bdbb8c4f9043ea6f17 --- tests/catch/include/hip_test_common.hh | 1 - tests/catch/unit/event/hipEventSynchronize.cc | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/catch/include/hip_test_common.hh b/tests/catch/include/hip_test_common.hh index ed8412b673..5f7b197596 100644 --- a/tests/catch/include/hip_test_common.hh +++ b/tests/catch/include/hip_test_common.hh @@ -397,7 +397,6 @@ static inline void runKernelForDuration(std::chrono::milliseconds duration, static size_t ticksPerSecond = findTicksPerSecond(); const auto millis = duration.count(); hipLaunchKernelGGL(waitKernel, dim3(1), dim3(1), 0, stream, ticksPerSecond * millis / 1000); - HIP_CHECK(hipGetLastError()); } } // namespace HipTest diff --git a/tests/catch/unit/event/hipEventSynchronize.cc b/tests/catch/unit/event/hipEventSynchronize.cc index e3c07bb395..a347badb22 100644 --- a/tests/catch/unit/event/hipEventSynchronize.cc +++ b/tests/catch/unit/event/hipEventSynchronize.cc @@ -110,13 +110,13 @@ TEST_CASE("Unit_hipEventSynchronize_NoEventRecord_Positive") { // Record the end_event HIP_CHECK(hipEventRecord(end_event, NULL)); + // End event has not been completed + HIP_CHECK_ERROR(hipEventQuery(end_event), hipErrorNotReady); // When hipEventSynchronized is called on event that has not been recorded, // the function returns immediately HIP_CHECK(hipEventSynchronize(dummy_event)); - // End event has not been completed - HIP_CHECK_ERROR(hipEventQuery(end_event), hipErrorNotReady); // Wait for end_event to complete HIP_CHECK(hipEventSynchronize(end_event));