SWDEV-408958 - Use LaunchDelayKernel and modify it to use same kernel based on real time clock for gfx10 and gfx11. (#370)

Change-Id: Iea8a48e8cbfa1745c7d5535dc5820133a4104087
This commit is contained in:
ROCm CI Service Account
2023-07-20 10:16:56 +05:30
committed by GitHub
orang tua faa2dd7cfb
melakukan 04080c2e2e
14 mengubah file dengan 79 tambahan dan 209 penghapusan
+23 -8
Melihat File
@@ -18,7 +18,29 @@ THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <utils.hh>
/**
* @addtogroup hipEventQuery hipEventQuery
* @{
* @ingroup EventTest
* `hipEventQuery(hipEvent_t event)` -
* Query the status of the specified event.
* ________________________
* Test cases from other modules:
* - @ref Unit_hipEventIpc
*/
/**
* Test Description
* ------------------------
* - Query events with a single and with multiple devices.
* Test source
* ------------------------
* - unit/event/Unit_hipEventQuery.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipEventQuery_DifferentDevice") {
hipEvent_t event1{}, event2{};
HIP_CHECK(hipEventCreate(&event1));
@@ -30,15 +52,10 @@ TEST_CASE("Unit_hipEventQuery_DifferentDevice") {
HIP_CHECK(hipStreamCreate(&stream));
REQUIRE(stream != nullptr);
HipTest::BlockingContext b_context1{stream}; // og context
// Block stream
{
HIP_CHECK(hipSetDevice(0));
HIP_CHECK(hipEventRecord(event1, stream));
b_context1.block_stream(); // blocked stream
REQUIRE(b_context1.is_blocked());
LaunchDelayKernel(std::chrono::milliseconds(3000), stream);
HIP_CHECK(hipEventRecord(event2, stream));
HIP_CHECK(hipEventSynchronize(event1));
@@ -58,8 +75,6 @@ TEST_CASE("Unit_hipEventQuery_DifferentDevice") {
HIP_CHECK(hipEventQuery(event1));
HIP_CHECK_ERROR(hipEventQuery(event2), hipErrorNotReady);
b_context1.unblock_stream();
HIP_CHECK(hipEventSynchronize(event2));
// Query, should be done now