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

Change-Id: Iea8a48e8cbfa1745c7d5535dc5820133a4104087
此提交包含在:
ROCm CI Service Account authored and GitHub committed 2023-07-20 10:16:56 +05:30
1 父節點 faa2dd7cfb
當前提交 04080c2e2e
14 file changed
+79 -209

No files matched your search

+6 -6
查看文件
@@ -25,7 +25,7 @@ THE SOFTWARE.
#include <hip_array_common.hh>
#include "hipArrayCommon.hh"
#include "DriverContext.hh"
#include <utils.hh>
/*
* This testcase verifies [ hipFree || hipFreeArray || hipFreeType::ArrayDestroy ||
* hipFreeType::HostFree with hipHostMalloc ]
@@ -54,7 +54,7 @@ TEST_CASE("Unit_hipFreeImplicitSyncDev") {
size_t size_mult = GENERATE(1, 32, 64, 128, 256);
HIP_CHECK(hipMalloc(&devPtr, sizeof(*devPtr) * size_mult));
HipTest::runKernelForDuration(delay);
LaunchDelayKernel(delay);
// make sure device is busy
HIP_CHECK_ERROR(hipStreamQuery(nullptr), hipErrorNotReady);
HIP_CHECK(hipFree(devPtr));
@@ -67,7 +67,7 @@ TEST_CASE("Unit_hipFreeImplicitSyncHost") {
HIP_CHECK(hipHostMalloc(&hostPtr, sizeof(*hostPtr) * size_mult));
HipTest::runKernelForDuration(delay);
LaunchDelayKernel(delay);
// make sure device is busy
HIP_CHECK_ERROR(hipStreamQuery(nullptr), hipErrorNotReady);
HIP_CHECK(hipHostFree(hostPtr));
@@ -88,7 +88,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeImplicitSyncArray", "", char, float, float2, flo
hipChannelFormatDesc desc = hipCreateChannelDesc<TestType>();
HIP_CHECK(hipMallocArray(&arrayPtr, &desc, width, height, hipArrayDefault));
HipTest::runKernelForDuration(delay);
LaunchDelayKernel(delay);
// make sure device is busy
HIP_CHECK_ERROR(hipStreamQuery(nullptr), hipErrorNotReady);
HIP_CHECK(hipFreeArray(arrayPtr));
@@ -103,7 +103,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeImplicitSyncArray", "", char, float, float2, flo
cuDesc.Format = vec_info::format;
cuDesc.NumChannels = vec_info::size;
HIP_CHECK(hipArrayCreate(&cuArrayPtr, &cuDesc));
HipTest::runKernelForDuration(delay);
LaunchDelayKernel(delay);
// make sure device is busy
HIP_CHECK_ERROR(hipStreamQuery(nullptr), hipErrorNotReady);
HIP_CHECK(hipArrayDestroy(cuArrayPtr));
@@ -120,7 +120,7 @@ TEMPLATE_TEST_CASE("Unit_hipFreeImplicitSyncArray", "", char, float, float2, flo
hipChannelFormatDesc desc = hipCreateChannelDesc<TestType>();
HIP_CHECK(hipMallocArray(&arrayPtr, &desc, extent.width, extent.height, hipArrayDefault));
HipTest::runKernelForDuration(delay);
LaunchDelayKernel(delay);
// make sure device is busy
HIP_CHECK_ERROR(hipStreamQuery(nullptr), hipErrorNotReady);
// Second free segfaults
+2 -2
查看文件
@@ -21,7 +21,7 @@ THE SOFTWARE.
*/
#include "MemUtils.hh"
#include <utils.hh>
/*
* These testcases verify that synchronization behaviour for memcpy functions with respect to
* the host.
@@ -156,7 +156,7 @@ static void runMemcpyTests(hipStream_t stream, bool async, allocType type, memTy
using namespace std::chrono_literals;
const std::chrono::duration<uint64_t, std::milli> delay = 100ms;
HipTest::runKernelForDuration(delay, stream);
LaunchDelayKernel(delay, stream);
memcpyCheck(type, memType, aPtr.first, data, fillerData, async, stream, fromHost);
checkForSync(stream, async, type, fromHost);
+2 -1
查看文件
@@ -21,6 +21,7 @@ THE SOFTWARE.
*/
#include <hip_test_common.hh>
#include <utils.hh>
/*
* These testcases verify that synchronous memset functions are asynchronous with respect to the
* host except when the target is pinned host memory or a Unified Memory region
@@ -406,7 +407,7 @@ void runTests(allocType type, memSetType memsetType, MultiDData data, hipStream_
std::pair<T*, T*> aPtr = initMemory<T>(type, memsetType, data);
using namespace std::chrono_literals;
const std::chrono::duration<uint64_t, std::milli> delay = 100ms;
HipTest::runKernelForDuration(delay, stream);
LaunchDelayKernel(delay, stream);
memsetCheck(aPtr.first, testValue, memsetType, data, async, stream);
if (async || type == allocType::deviceMalloc) {