SWDEV-514841 - Remove invalid stream tests which leads to segfault

Change-Id: I230c4ccc0d2f591cbf2cd0e019f910094f4f3f26
Αυτή η υποβολή περιλαμβάνεται σε:
Pengda Xie
2025-02-12 17:32:50 -08:00
υποβλήθηκε από Ioannis Assiouras
γονέας c4135a6090
υποβολή b46d6abdcb
21 αρχεία άλλαξαν με 61 προσθήκες και 136 διαγραφές
@@ -413,11 +413,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_Functional_CountDiffer_1") {
ret = hipGraphExecUpdate(graphExec1, graph2, &hErrorNode_out, &updateResult_out);
REQUIRE(hipErrorGraphExecUpdateFailure == ret);
#if HT_NVIDIA
REQUIRE(hipGraphExecUpdateErrorNotSupported == updateResult_out);
#else
REQUIRE(hipGraphExecUpdateErrorTopologyChanged == updateResult_out);
#endif
REQUIRE(NULL == hErrorNode_out);
HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false);
@@ -480,13 +476,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_Functional_CountDiffer_2") {
hipMemcpyHostToDevice));
HIP_CHECK(hipGraphInstantiate(&graphExec2, graph2, nullptr, nullptr, 0));
ret = hipGraphExecUpdate(graphExec2, graph1, &hErrorNode_out, &updateResult_out);
#if HT_NVIDIA
REQUIRE(hipErrorGraphExecUpdateFailure == ret);
REQUIRE(hipGraphExecUpdateErrorNotSupported == updateResult_out);
REQUIRE(NULL == hErrorNode_out);
#else
REQUIRE(hipSuccess == ret);
#endif
HIP_CHECK(hipGraphExecDestroy(graphExec2));
HIP_CHECK(hipGraphDestroy(graph2));
}
@@ -499,11 +489,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_Functional_CountDiffer_2") {
hipMemcpyHostToDevice));
ret = hipGraphExecUpdate(graphExec3, graph3, &hErrorNode_out, &updateResult_out);
REQUIRE(hipErrorGraphExecUpdateFailure == ret);
#if HT_NVIDIA
REQUIRE(hipGraphExecUpdateErrorNotSupported == updateResult_out);
#else
REQUIRE(hipGraphExecUpdateErrorTopologyChanged == updateResult_out);
#endif
REQUIRE(NULL == hErrorNode_out);
HIP_CHECK(hipGraphExecDestroy(graphExec3));
@@ -626,11 +612,7 @@ TEST_CASE("Unit_hipGraphExecUpdate_Negative_NodeType_Changed") {
HIP_CHECK(hipGraphAddDependencies(graph2, &memcpy_A, &memsetNode, 1));
ret = hipGraphExecUpdate(graphExec, graph2, &hErrorNode_out, &updateResult_out);
REQUIRE(hipErrorGraphExecUpdateFailure == ret);
#if HT_NVIDIA
REQUIRE(hipGraphExecUpdateErrorTopologyChanged == updateResult_out);
#else
REQUIRE(hipGraphExecUpdateErrorNodeTypeChanged == updateResult_out);
#endif
REQUIRE(memsetNode == hErrorNode_out);
HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false);
@@ -95,8 +95,9 @@ TEST_CASE("Unit_hipGraphLaunch_Negative") {
HIP_CHECK(hipGraphDestroy(graph));
HIP_CHECK(hipStreamDestroy(stream));
}
/* In this case in CUDA setup this api call is giving - unknown error (999)
So enabling this test for both AMD and CUDA by checking with hipSuccess */
/* In this case in CUDA setup this api call leads to undefined behavior
So enabling this test only for AMD and checking with hipSuccess */
#if HT_AMD
SECTION("Destroy stream and try to launch respective executable graph") {
constexpr size_t Nbytes = 1024;
hipGraph_t graph;
@@ -133,6 +134,7 @@ TEST_CASE("Unit_hipGraphLaunch_Negative") {
HIP_CHECK(hipGraphExecDestroy(graphExec));
HIP_CHECK(hipGraphDestroy(graph));
}
#endif
SECTION("Destroy graph and try to launch respective executable graph") {
constexpr size_t Nbytes = 1024;
hipGraph_t graph;
@@ -94,12 +94,6 @@ TEST_CASE("Unit_hipGraphNodeFindInClone_Negative") {
REQUIRE(hipGraphNodeFindInClone(&clonedgraphnode, graphnode, graph) ==
hipErrorInvalidValue);
}
SECTION("Destroy the graph node and find in cloned graph") {
HIP_CHECK(hipGraphDestroyNode(graphnode));
REQUIRE(hipGraphNodeFindInClone(&clonedgraphnode, graphnode, clonedgraph) ==
hipErrorInvalidValue);
}
#endif
SECTION("Pass invalid original graphnode") {
@@ -67,7 +67,7 @@ TEST_CASE("Unit_hipLaunchHostFunc_Negative_Parameters") {
SECTION("Pass functions as nullptr") {
HIP_CHECK_ERROR(hipLaunchHostFunc(stream, nullptr, nullptr), hipErrorInvalidValue);
}
#if HT_AMD
SECTION("Pass uninitialized stream") {
hipHostFn_t fn = hostNodeCallbackDummy;
constexpr auto InvalidStream = [] {
@@ -76,6 +76,7 @@ TEST_CASE("Unit_hipLaunchHostFunc_Negative_Parameters") {
};
HIP_CHECK_ERROR(hipLaunchHostFunc(InvalidStream(), fn, nullptr), hipErrorContextIsDestroyed);
}
#endif
}
/**
@@ -56,12 +56,13 @@ TEST_CASE("Unit_hipStreamEndCapture_Negative_Parameters") {
}
#if HT_NVIDIA
SECTION("Pass graph as nullptr") {
HIP_CHECK_ERROR(hipStreamEndCapture(stream, nullptr), hipErrorInvalidValue);
HIP_CHECK_ERROR(hipStreamEndCapture(stream, nullptr), hipErrorIllegalState);
}
#endif
SECTION("End capture on stream where capture has not yet started") {
HIP_CHECK_ERROR(hipStreamEndCapture(stream, &graph), hipErrorIllegalState);
}
#if HT_AMD
SECTION("Destroy stream and try to end capture") {
hipStream_t destroyed_stream;
HIP_CHECK(hipStreamCreate(&destroyed_stream));
@@ -69,6 +70,7 @@ TEST_CASE("Unit_hipStreamEndCapture_Negative_Parameters") {
HIP_CHECK(hipStreamDestroy(destroyed_stream));
HIP_CHECK_ERROR(hipStreamEndCapture(destroyed_stream, &graph), hipErrorContextIsDestroyed);
}
#endif
}
/**
@@ -64,12 +64,12 @@ TEST_CASE("Unit_hipStreamEndCapture_Negative") {
hipStream_t stream;
HIP_CHECK(hipStreamCreate(&stream));
ret = hipStreamEndCapture(stream, nullptr);
REQUIRE(hipErrorInvalidValue == ret);
REQUIRE(hipErrorIllegalState == ret);
HIP_CHECK(hipStreamDestroy(stream));
}
SECTION("Pass graph as nullptr and stream as hipStreamPerThread") {
ret = hipStreamEndCapture(hipStreamPerThread, nullptr);
REQUIRE(hipErrorInvalidValue == ret);
REQUIRE(hipErrorIllegalState == ret);
}
#endif
SECTION("End capture on stream where capture has not yet started") {
@@ -80,6 +80,7 @@ TEST_CASE("Unit_hipStreamEndCapture_Negative") {
REQUIRE(hipErrorIllegalState == ret);
HIP_CHECK(hipStreamDestroy(stream));
}
#if HT_AMD
SECTION("Destroy stream and try to end capture") {
hipStream_t stream;
hipGraph_t graph;
@@ -89,6 +90,7 @@ TEST_CASE("Unit_hipStreamEndCapture_Negative") {
ret = hipStreamEndCapture(stream, &graph);
REQUIRE(hipErrorContextIsDestroyed == ret);
}
#endif
SECTION("Destroy graph and try to end capture in between") {
hipStream_t stream{nullptr};
hipGraph_t graph{nullptr};
@@ -185,15 +185,6 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_Negative_Parameters") {
HIP_CHECK(hipStreamEndCapture(stream, &graph));
HIP_CHECK(hipGraphDestroy(graph));
}
SECTION("Capture status when stream is uninitialized") {
constexpr auto InvalidStream = [] {
StreamGuard sg(Streams::created);
return sg.stream();
};
HIP_CHECK_ERROR(hipStreamGetCaptureInfo(InvalidStream(), &cStatus, &capSequenceID),
hipErrorContextIsDestroyed);
}
#endif
}
@@ -246,16 +246,6 @@ TEST_CASE("Unit_hipStreamGetCaptureInfo_v2_Negative_Parameters") {
HIP_CHECK(hipStreamEndCapture(stream, &graph));
HIP_CHECK(hipGraphDestroy(graph));
}
SECTION("Capture status when stream is uninitialized") {
constexpr auto InvalidStream = [] {
StreamGuard sg(Streams::created);
return sg.stream();
};
HIP_CHECK_ERROR(hipStreamGetCaptureInfo_v2(InvalidStream(), &captureStatus, &capSequenceID,
&capInfoGraph, &nodelist, &numDependencies),
hipErrorContextIsDestroyed);
}
#endif
}
@@ -62,18 +62,6 @@ TEST_CASE("Unit_hipStreamIsCapturing_Negative_Parameters") {
HIP_CHECK(hipStreamEndCapture(stream, &graph));
HIP_CHECK(hipGraphDestroy(graph));
}
#if HT_NVIDIA // EXSWHTEC-216
SECTION("Check capture status when stream is uninitialized") {
hipStreamCaptureStatus cStatus;
constexpr auto InvalidStream = [] {
StreamGuard sg(Streams::created);
return sg.stream();
};
HIP_CHECK_ERROR(hipStreamIsCapturing(InvalidStream(), &cStatus), hipErrorContextIsDestroyed);
}
#endif
}
/**