[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
committato da Rahul Manocha
parent 2fb506a22c
commit b46f7c8f6a
3 ha cambiato i file con 17 aggiunte e 12 eliminazioni
@@ -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));