EXSWHTEC-172 - Hip graph launching and execution tests #36

Change-Id: I2cfadf6335a582f593191860d5084cb79fa411b3
This commit is contained in:
Nives Vukovic
2023-11-16 10:53:38 +00:00
committed by Maneesh Gupta
orang tua 55c04d6169
melakukan 133521b22f
6 mengubah file dengan 719 tambahan dan 586 penghapusan
+38 -14
Melihat File
@@ -20,26 +20,51 @@ THE SOFTWARE.
#include <hip_test_common.hh>
/**
Negative Testcase Scenarios :
1) Pass hipGraphExecDestroy with nullptr.
2) Pass hipGraphExecDestroy with un-initilze structure.
3) Destroy graph before exec-graph destroyed and verify no crash occurs.
*/
* @addtogroup hipGraphExecDestroy hipGraphExecDestroy
* @{
* @ingroup GraphTest
* `hipGraphExecDestroy(hipGraphExec_t graphExec)` -
* Destroys an executable graph
*/
/**
* Test Description
* ------------------------
* - Test to verify API behavior with invalid arguments:
* -# GraphExec is nullptr
* -# GraphExec is uninitialized
* Test source
* ------------------------
* - unit/graph/hipGraphExecDestroy.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphExecDestroy_Negative_Parameters") {
TEST_CASE("Unit_hipGraphExecDestroy_Negative") {
hipError_t ret;
SECTION("Pass hipGraphExecDestroy with nullptr") {
ret = hipGraphExecDestroy(nullptr);
REQUIRE(hipErrorInvalidValue == ret);
HIP_CHECK_ERROR(hipGraphExecDestroy(nullptr), hipErrorInvalidValue);
}
SECTION("Pass hipGraphExecDestroy with un-initilze structure") {
hipGraphExec_t graphExec{};
ret = hipGraphExecDestroy(graphExec);
REQUIRE(hipErrorInvalidValue == ret);
hipGraphExec_t graph_exec{};
HIP_CHECK_ERROR(hipGraphExecDestroy(graph_exec), hipErrorInvalidValue);
}
}
TEST_CASE("Unit_hipGraphExecDestroy_Sequence") {
/**
* Test Description
* ------------------------
* - Basic positive test for hipGraphExecDestroy
* - create an executable graph and then destroy it
* Test source
* ------------------------
* - unit/graph/hipGraphExecDestroy.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphExecDestroy_Positive_Basic") {
hipGraph_t graph;
hipGraphExec_t graphExec;
hipStream_t streamForGraph;
@@ -70,4 +95,3 @@ TEST_CASE("Unit_hipGraphExecDestroy_Sequence") {
HIP_CHECK(hipGraphExecDestroy(graphExec));
HIP_CHECK(hipStreamDestroy(streamForGraph));
}