SWDEV-454659 - Correct test setup, Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters

Pitch cannot be lower then width

Change-Id: Ib42f036f1158b500ce8892643178469a2ec7dc88
This commit is contained in:
Marko Arandjelovic
2024-04-08 13:38:36 +02:00
committed by Rakesh Roy
parent 850511cc28
commit 27be56f329
3 changed files with 10 additions and 10 deletions
@@ -219,7 +219,6 @@
"Unit_hipExtLaunchMultiKernelMultiDevice_Negative_MultiKernelSameDevice", "Unit_hipExtLaunchMultiKernelMultiDevice_Negative_MultiKernelSameDevice",
"=== Below tests are failing PSDB ===", "=== Below tests are failing PSDB ===",
"Unit_hipGraphExecMemcpyNodeSetParams_Positive_Basic", "Unit_hipGraphExecMemcpyNodeSetParams_Positive_Basic",
"Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters",
"Unit_hipMemcpy3D_Positive_Synchronization_Behavior", "Unit_hipMemcpy3D_Positive_Synchronization_Behavior",
"Unit_hipMemcpyParam2D_Positive_Synchronization_Behavior", "Unit_hipMemcpyParam2D_Positive_Synchronization_Behavior",
"Unit_hipMemcpyAsync_Positive_Synchronization_Behavior", "Unit_hipMemcpyAsync_Positive_Synchronization_Behavior",
@@ -361,7 +361,6 @@
"Unit_hipFreeMipmappedArray_Negative_DoubleFree", "Unit_hipFreeMipmappedArray_Negative_DoubleFree",
"Unit_hipFreeMipmappedArrayMultiTArray - int", "Unit_hipFreeMipmappedArrayMultiTArray - int",
"Unit_hipGraphExecMemcpyNodeSetParams_Positive_Basic", "Unit_hipGraphExecMemcpyNodeSetParams_Positive_Basic",
"Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters",
"Unit_hipMemcpy3D_Positive_Synchronization_Behavior", "Unit_hipMemcpy3D_Positive_Synchronization_Behavior",
"Unit_hipMemcpyParam2D_Positive_Synchronization_Behavior", "Unit_hipMemcpyParam2D_Positive_Synchronization_Behavior",
"Unit_hipMemcpyAsync_Positive_Synchronization_Behavior", "Unit_hipMemcpyAsync_Positive_Synchronization_Behavior",
@@ -165,9 +165,10 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters") {
int src[2] = {}, dst[2] = {}; int src[2] = {}, dst[2] = {};
auto params = GetMemcpy3DParms(make_hipPitchedPtr(dst, 0, sizeof(dst), 0), make_hipPos(0, 0, 0), auto params =
make_hipPitchedPtr(src, 0, sizeof(src), 0), make_hipPos(0, 0, 0), GetMemcpy3DParms(make_hipPitchedPtr(dst, sizeof(dst), sizeof(dst), 0), make_hipPos(0, 0, 0),
make_hipExtent(sizeof(dst), 1, 1), hipMemcpyDefault); make_hipPitchedPtr(src, sizeof(src), sizeof(src), 0), make_hipPos(0, 0, 0),
make_hipExtent(sizeof(dst), 1, 1), hipMemcpyDefault);
hipGraphNode_t node = nullptr; hipGraphNode_t node = nullptr;
HIP_CHECK(hipGraphAddMemcpyNode(&node, graph, nullptr, 0, &params)); HIP_CHECK(hipGraphAddMemcpyNode(&node, graph, nullptr, 0, &params));
@@ -185,9 +186,10 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters") {
} }
auto f = [&](void* dst, void* src, size_t count, hipMemcpyKind kind) { auto f = [&](void* dst, void* src, size_t count, hipMemcpyKind kind) {
auto params = GetMemcpy3DParms(make_hipPitchedPtr(dst, 0, sizeof(dst), 0), make_hipPos(0, 0, 0), auto params =
make_hipPitchedPtr(src, 0, sizeof(src), 0), make_hipPos(0, 0, 0), GetMemcpy3DParms(make_hipPitchedPtr(dst, sizeof(dst), sizeof(dst), 0), make_hipPos(0, 0, 0),
make_hipExtent(count, 1, 1), kind); make_hipPitchedPtr(src, sizeof(src), sizeof(src), 0), make_hipPos(0, 0, 0),
make_hipExtent(count, 1, 1), kind);
return hipGraphExecMemcpyNodeSetParams(graph_exec, node, &params); return hipGraphExecMemcpyNodeSetParams(graph_exec, node, &params);
}; };
MemcpyWithDirectionCommonNegativeTests(f, dst, src, sizeof(dst), hipMemcpyDefault); MemcpyWithDirectionCommonNegativeTests(f, dst, src, sizeof(dst), hipMemcpyDefault);
@@ -200,14 +202,14 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters") {
SECTION("count larger than dst allocation size") { SECTION("count larger than dst allocation size") {
LinearAllocGuard<int> dev_dst(LinearAllocs::hipMalloc, sizeof(int)); LinearAllocGuard<int> dev_dst(LinearAllocs::hipMalloc, sizeof(int));
params.dstPtr = make_hipPitchedPtr(dev_dst.ptr(), 0, sizeof(int), 0); params.dstPtr = make_hipPitchedPtr(dev_dst.ptr(), sizeof(int), sizeof(int), 0);
HIP_CHECK_ERROR(hipGraphExecMemcpyNodeSetParams(graph_exec, node, &params), HIP_CHECK_ERROR(hipGraphExecMemcpyNodeSetParams(graph_exec, node, &params),
hipErrorInvalidValue); hipErrorInvalidValue);
} }
SECTION("count larger than src allocation size") { SECTION("count larger than src allocation size") {
LinearAllocGuard<int> dev_src(LinearAllocs::hipMalloc, sizeof(int)); LinearAllocGuard<int> dev_src(LinearAllocs::hipMalloc, sizeof(int));
params.dstPtr = make_hipPitchedPtr(dev_src.ptr(), 0, sizeof(int), 0); params.dstPtr = make_hipPitchedPtr(dev_src.ptr(), sizeof(int), sizeof(int), 0);
HIP_CHECK_ERROR(hipGraphExecMemcpyNodeSetParams(graph_exec, node, &params), HIP_CHECK_ERROR(hipGraphExecMemcpyNodeSetParams(graph_exec, node, &params),
hipErrorInvalidValue); hipErrorInvalidValue);
} }