SWDEV-454659 - Correct test setup, Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters

Pitch cannot be lower then width

Change-Id: Ib42f036f1158b500ce8892643178469a2ec7dc88
Этот коммит содержится в:
Marko Arandjelovic
2024-04-08 13:38:36 +02:00
коммит произвёл Rakesh Roy
родитель 850511cc28
Коммит 27be56f329
3 изменённых файлов: 10 добавлений и 10 удалений
-1
Просмотреть файл
@@ -219,7 +219,6 @@
"Unit_hipExtLaunchMultiKernelMultiDevice_Negative_MultiKernelSameDevice",
"=== Below tests are failing PSDB ===",
"Unit_hipGraphExecMemcpyNodeSetParams_Positive_Basic",
"Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters",
"Unit_hipMemcpy3D_Positive_Synchronization_Behavior",
"Unit_hipMemcpyParam2D_Positive_Synchronization_Behavior",
"Unit_hipMemcpyAsync_Positive_Synchronization_Behavior",
-1
Просмотреть файл
@@ -361,7 +361,6 @@
"Unit_hipFreeMipmappedArray_Negative_DoubleFree",
"Unit_hipFreeMipmappedArrayMultiTArray - int",
"Unit_hipGraphExecMemcpyNodeSetParams_Positive_Basic",
"Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters",
"Unit_hipMemcpy3D_Positive_Synchronization_Behavior",
"Unit_hipMemcpyParam2D_Positive_Synchronization_Behavior",
"Unit_hipMemcpyAsync_Positive_Synchronization_Behavior",
+10 -8
Просмотреть файл
@@ -165,9 +165,10 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters") {
int src[2] = {}, dst[2] = {};
auto params = GetMemcpy3DParms(make_hipPitchedPtr(dst, 0, sizeof(dst), 0), make_hipPos(0, 0, 0),
make_hipPitchedPtr(src, 0, sizeof(src), 0), make_hipPos(0, 0, 0),
make_hipExtent(sizeof(dst), 1, 1), hipMemcpyDefault);
auto params =
GetMemcpy3DParms(make_hipPitchedPtr(dst, sizeof(dst), sizeof(dst), 0), make_hipPos(0, 0, 0),
make_hipPitchedPtr(src, sizeof(src), sizeof(src), 0), make_hipPos(0, 0, 0),
make_hipExtent(sizeof(dst), 1, 1), hipMemcpyDefault);
hipGraphNode_t node = nullptr;
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 params = GetMemcpy3DParms(make_hipPitchedPtr(dst, 0, sizeof(dst), 0), make_hipPos(0, 0, 0),
make_hipPitchedPtr(src, 0, sizeof(src), 0), make_hipPos(0, 0, 0),
make_hipExtent(count, 1, 1), kind);
auto params =
GetMemcpy3DParms(make_hipPitchedPtr(dst, sizeof(dst), sizeof(dst), 0), make_hipPos(0, 0, 0),
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);
};
MemcpyWithDirectionCommonNegativeTests(f, dst, src, sizeof(dst), hipMemcpyDefault);
@@ -200,14 +202,14 @@ TEST_CASE("Unit_hipGraphExecMemcpyNodeSetParams_Negative_Parameters") {
SECTION("count larger than dst allocation size") {
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),
hipErrorInvalidValue);
}
SECTION("count larger than src allocation size") {
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),
hipErrorInvalidValue);
}