[SWDEV-454661] - Test updates for memcpy direction change

Change-Id: I4065595f92abc101ce54fa587af874c1d6737033


[ROCm/hip-tests commit: 23259fb1c6]
This commit is contained in:
Rahul Manocha
2024-04-26 12:34:39 -07:00
committed by Rahul Manocha
vanhempi 2fb506a22c
commit b46f7c8f6a
3 muutettua tiedostoa jossa 17 lisäystä ja 12 poistoa
@@ -1519,6 +1519,9 @@
"Unit_Warp_Ballot_Positive_Basic",
"Unit_Warp_Vote_Any_Positive_Basic",
"Unit_Warp_Vote_All_Positive_Basic",
"=== Below Tests fail in stress test 06/11/24 ===",
"Unit_hipGraphExecMemcpyNodeSetParams_Negative_Changing_Memcpy_Direction",
"Unit_hipGraphExecMemcpyNodeSetParams1D_Negative_Changing_Memcpy_Direction",
#endif
#if defined gfx1030
"=== SWDEV-445961: These tests hang in PSDB stress test on 09/02/2024 ===",
@@ -229,13 +229,14 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters") {
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Changing_Memcpy_Direction") {
int host;
LinearAllocGuard<int> host(LinearAllocs::hipHostMalloc, sizeof(int));
LinearAllocGuard<int> dev(LinearAllocs::hipMalloc, sizeof(int));
const auto [dir, src, dst] =
GENERATE_REF(std::make_tuple(hipMemcpyHostToHost, &host, &host),
std::make_tuple(hipMemcpyHostToDevice, &host, dev.ptr()),
std::make_tuple(hipMemcpyDeviceToHost, dev.ptr(), &host),
GENERATE_REF(std::make_tuple(hipMemcpyHostToHost, host.ptr(), host.ptr()),
std::make_tuple(hipMemcpyHostToDevice, host.ptr(), dev.ptr()),
std::make_tuple(hipMemcpyDeviceToHost, dev.ptr(), host.ptr()),
std::make_tuple(hipMemcpyDeviceToDevice, dev.ptr(), dev.ptr()));
hipGraph_t graph = nullptr;
@@ -251,7 +252,7 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Changing_Memcpy_Directi
hipGraphExec_t graph_exec = nullptr;
HIP_CHECK(hipGraphInstantiate(&graph_exec, graph, nullptr, nullptr, 0));
const auto set_dir = GENERATE(hipMemcpyHostToHost, hipMemcpyHostToDevice, hipMemcpyDeviceToHost,
const auto set_dir = GENERATE(hipMemcpyHostToHost, hipMemcpyHostToDevice, hipMemcpyDeviceToHost,
hipMemcpyDeviceToDevice, hipMemcpyDefault);
if (dir == set_dir) {
HIP_CHECK(hipGraphExecDestroy(graph_exec));
@@ -261,7 +262,6 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Changing_Memcpy_Directi
params.kind = set_dir;
HIP_CHECK_ERROR(hipGraphExecMemcpyNodeSetParams(graph_exec, node, &params), hipErrorInvalidValue);
HIP_CHECK(hipGraphExecDestroy(graph_exec));
HIP_CHECK(hipGraphDestroy(graph));
}
@@ -218,14 +218,16 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Negative_Parameters") {
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams1D_Negative_Changing_Memcpy_Direction") {
int host;
LinearAllocGuard<int> dev(LinearAllocs::hipMalloc, sizeof(int));
LinearAllocGuard<int> host1(LinearAllocs::hipHostMalloc, sizeof(int));
LinearAllocGuard<int> host2(LinearAllocs::hipHostMalloc, sizeof(int));
LinearAllocGuard<int> dev1(LinearAllocs::hipMalloc, sizeof(int));
LinearAllocGuard<int> dev2(LinearAllocs::hipMalloc, sizeof(int));
const auto [dir, src, dst] =
GENERATE_REF(std::make_tuple(hipMemcpyHostToHost, &host, &host),
std::make_tuple(hipMemcpyHostToDevice, &host, dev.ptr()),
std::make_tuple(hipMemcpyDeviceToHost, dev.ptr(), &host),
std::make_tuple(hipMemcpyDeviceToDevice, dev.ptr(), dev.ptr()));
GENERATE_REF(std::make_tuple(hipMemcpyHostToHost, host1.ptr(), host2.ptr()),
std::make_tuple(hipMemcpyHostToDevice, host1.ptr(), dev1.ptr()),
std::make_tuple(hipMemcpyDeviceToHost, dev1.ptr(), host1.ptr()),
std::make_tuple(hipMemcpyDeviceToDevice, dev1.ptr(), dev2.ptr()));
hipGraph_t graph = nullptr;
HIP_CHECK(hipGraphCreate(&graph, 0));