Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXSWHTEC-224 - Test cases ID clean up and documentation for Graph Management #95

Open
wants to merge 141 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
cea96af
SWDEV-355313 - Move catch tests and samples
gargrahul Oct 26, 2022
909e7e4
SWDEV-355313 - Add README
gargrahul Nov 7, 2022
094b9af
SWDEV-355313 - Update amd-staging branch
gargrahul Nov 28, 2022
32ce47c
EXSWHTEC-189 - Instate the usage of HIP_CHECK_ERROR
music-dino Nov 30, 2022
96fb815
EXSWHTEC-189 - Implement positive tests equivalent to hipMemcpy tests
music-dino Dec 1, 2022
070bb7c
EXSWHTEC-174 - Add Doxygen configuration and common header with group…
milos-mozetic Dec 1, 2022
9daa6d0
SWDEV-355313 - Update README
gargrahul Dec 2, 2022
a9169f7
EXSWHTEC-198: Implement tests for hipStreamGetCaptureInfo, hipStreamG…
nives-vukovic Dec 2, 2022
16d2130
EXSWHTEC-198: Modify doxygen comments
nives-vukovic Dec 2, 2022
003bba5
EXSWHTEC-192 - Implement basic positive test cases for int
music-dino Dec 2, 2022
e8339be
EXSWHTEC-192 - Implement new and update existing tests for the hipGra…
music-dino Dec 2, 2022
51f39ed
EXSWHTEC-192 - Implement positive and negative tests for hipGraphMemc…
music-dino Dec 3, 2022
9282142
EXSWHTEC-192 - Implement positive and negative tests for hipGraphExec…
music-dino Dec 3, 2022
4b56ed6
EXSWHTEC-192 - Refactor positive and negative tests
music-dino Dec 3, 2022
47e617f
EXSWHTEC-192 - Implement positive and negative tests for hipGraphAddM…
music-dino Dec 3, 2022
eab7ffd
EXSWHTEC-192 - Implement positive and negative tests for hipGraphMemc…
music-dino Dec 3, 2022
5bd77cc
EXSWHTEC-192 - Implement positive and negative tests for hipGraphExec…
music-dino Dec 3, 2022
f1ea13c
EXSWHTEC-192 - Implement additional negative parameter tests for all …
music-dino Dec 4, 2022
93a33b4
EXSWHTEC-192 - Implement additional common negative tests for node ad…
music-dino Dec 4, 2022
e0b1be9
EXSWHTEC-193 - Implement positive and negative tests for hipGraphAddM…
music-dino Dec 4, 2022
7cb1675
EXSWHTEC-193 - Implement positive and negative tests for hipGraphMems…
music-dino Dec 4, 2022
6290f8f
EXSWHTEC-193 - Implement positive and negative tests for hipGraphExec…
music-dino Dec 4, 2022
aab5793
Implement negative tests for hipGraphMemsetNodeGetParams
music-dino Dec 4, 2022
a9fad2d
EXSWHTEC-169 - Implement additional tests for Kernel Graph Node APIs
mirza-halilcevic Dec 5, 2022
01ffaef
EXSWHTEC-191 - Implement additional tests for Host Graph Node APIs
mirza-halilcevic Dec 5, 2022
54c1354
EXSWHTEC-170 - Implement tests for Kernel Graph Node Attribute APIs
mirza-halilcevic Dec 5, 2022
cf7e1f0
EXSWHTEC-191 - Disable failing test sections on AMD.
mirza-halilcevic Dec 5, 2022
961cee8
EXSWHTEC-170 - Disable failing test sections on AMD.
mirza-halilcevic Dec 5, 2022
6bc73b9
EXSWHTEC-192 - Coerce the code to compile and not return invalid symb…
music-dino Dec 5, 2022
8f62a86
EXSWHTEC-198: Make minor test modification
nives-vukovic Dec 5, 2022
45a5c51
Merge remote-tracking branch 'origin/doxygen_configuration' into hipG…
music-dino Dec 5, 2022
2a205ed
EXSWHTEC-200 - Add support for TEMPLATE_TEST_CASE preprocessing
milos-mozetic Dec 5, 2022
da726ce
EXSWHTEC-198: Fix identation issues
nives-vukovic Dec 5, 2022
aaadbc0
EXSWHTEC-193 - Add doxygen annotations
music-dino Dec 5, 2022
ae9fe5f
EXSWHTEC-145: Implement tests for hipStreamBeginCapture and hipStream…
nives-vukovic Nov 30, 2022
e240e9f
EXSWHTEC-145: Implement tests for hipStreamUpdateCaptureDependencies,…
nives-vukovic Nov 30, 2022
310d6c1
EXSWHTEC-145: Fix doxygen comments and identation issues
nives-vukovic Dec 5, 2022
512c2e4
Merge remote-tracking branch 'origin/doxygen_configuration' into hipG…
music-dino Dec 5, 2022
0b6e840
Merge remote-tracking branch 'origin/doxygen_configuration' into hipG…
music-dino Dec 5, 2022
14810d3
EXSWHTEC-192 - Add doxygen annotations
music-dino Dec 5, 2022
c49043e
SWDEV-355313 - Update latest code
gargrahul Dec 6, 2022
3b03df1
EXSWHTEC-193 - Add a dynamic section in positive test for memset for …
music-dino Dec 6, 2022
dad66d7
Implement common negative tests for node addition APIs
music-dino Dec 6, 2022
57bc654
Merge branch 'graph_test_common' into hipGraphMemsetNode_tests
music-dino Dec 6, 2022
e945d92
Merge branch 'graph_test_common' into hipGraphMemcpyNodeToFromSymbol_…
music-dino Dec 6, 2022
b93c7a8
EXSWHTEC-192 - Update code to use new graph_tests_common.hh
music-dino Dec 6, 2022
de804fb
Merge remote-tracking branch 'origin/graph_test_common' into hipGraph…
music-dino Dec 6, 2022
c113b0a
EXSWHTEC-189 - Reorganize code for hipGraphAddMemcpyNode1D
music-dino Dec 6, 2022
85bf509
EXSWHTEC-189 - Reorganize code for hipGraphMemcpyNodeSetParams
music-dino Dec 6, 2022
2b17028
EXSWHTEC-189 - Reorganize code and implement new test case for hipGra…
music-dino Dec 6, 2022
d8d49de
Merge remote-tracking branch 'origin/doxygen_configuration' into hipG…
music-dino Dec 6, 2022
ddbc714
EXSWHTEC-189 - Add doxygen annotations
music-dino Dec 6, 2022
e459a98
Disable sections that fail due to defects
music-dino Dec 6, 2022
ed31247
Merge branch 'graph_test_common' into hipGraphMemcpyNodeToFromSymbol_…
music-dino Dec 6, 2022
67ce4c9
Merge branch 'graph_test_common' into hipGraphMemcpyNode1D_tests
music-dino Dec 6, 2022
c95176c
Merge branch 'graph_test_common' into hipGraphMemsetNode_tests
music-dino Dec 6, 2022
9dc43ec
EXSWHTEC-193 - Disable test that fail due to defects
music-dino Dec 6, 2022
616870e
EXWHTEC-189 - Disable tests that fail due to defects
music-dino Dec 7, 2022
98fdac0
EXSWHTEC-94 - Add resource guards and utils for 2D/3D allocations and…
nives-vukovic Dec 7, 2022
0c3128d
EXSWHTEC-194 - Implement tests for User Object Graph APIs
mirza-halilcevic Dec 7, 2022
d62fa5d
EXSWHTEC-192 - Disable tests that fail due to defects
music-dino Dec 7, 2022
d8f732b
EXSWHTEC-198: Refactor and disable tests that fail on AMD
nives-vukovic Dec 8, 2022
7339f3a
Merge remote-tracking branch 'origin/develop' into hipStreamCaptureIn…
nives-vukovic Dec 8, 2022
eb9c799
EXSWHTEC-173 - Implement tests for Graph Node dependencies APIs
nives-vukovic Dec 8, 2022
32c3815
EXSWHTEC-145: Refactor and fix minor issues
nives-vukovic Dec 8, 2022
e368574
Merge remote-tracking branch 'origin/develop' into hipStreamCapture_t…
nives-vukovic Dec 8, 2022
96c8fbf
EXSWHTEC-145: Disable tests that fail on AMD
nives-vukovic Dec 8, 2022
f3b7a6c
EXSWHTEC-171 - Implement positive and negative unit tests for the fol…
marko-veniger Dec 8, 2022
80a2ac9
EXSWHTEC-172 - Implement unit tests for Graph launching and execution
marko-veniger Dec 8, 2022
12e34b9
Merge remote-tracking branch 'origin/develop' into utils
nives-vukovic Dec 9, 2022
15614ba
EXSWHTEC-94 - Extend stream guard and add guards for multiple events …
nives-vukovic Dec 9, 2022
c011cb2
Merge remote-tracking branch 'origin/utils' into hipStreamCaptureInfo…
nives-vukovic Dec 9, 2022
593a6a5
EXSWHTEC-198 - Code formatting
nives-vukovic Dec 9, 2022
210746f
Merge remote-tracking branch 'origin/utils' into hipStreamCapture_tests
nives-vukovic Dec 9, 2022
e896db6
EXSWHTEC-145 - Code formatting
nives-vukovic Dec 9, 2022
49bb4e5
EXSWHTEC-178 - Implement tests for Event Graph Node APIs
nives-vukovic Dec 9, 2022
e9ff120
Merge remote-tracking branch 'origin/doxygen_configuration' into hipG…
mirza-halilcevic Dec 9, 2022
4025135
EXSWHTEC-178 - Code formatting
nives-vukovic Dec 9, 2022
ba017da
EXSWHTEC-178 - Code formatting of hipGraphEventWaitNodeSetEvent
nives-vukovic Dec 9, 2022
11dc060
EXSWHTEC-178 - Add positive parameters test for hipGraphAddEventRecor…
nives-vukovic Dec 9, 2022
4b83f8e
EXSWHTEC-217 - Implement new and update existing tests for the
mirza-halilcevic Dec 9, 2022
ae12bbd
EXSWHTEC-217 - Disable tests with defects on AMD.
mirza-halilcevic Dec 9, 2022
116406b
EXSWHTEC-169 - Fix formatting.
mirza-halilcevic Dec 9, 2022
fd8a294
Merge remote-tracking branch 'origin/develop' into hipGraphKernelNode…
mirza-halilcevic Dec 9, 2022
e1a8a68
Merge remote-tracking branch 'origin/develop' into hipGraphKernelNode…
mirza-halilcevic Dec 9, 2022
0972551
Merge remote-tracking branch 'origin/doxygen_configuration' into hipG…
mirza-halilcevic Dec 9, 2022
6985c27
Merge remote-tracking branch 'origin/develop' into hipGraphHostNode_t…
mirza-halilcevic Dec 9, 2022
8a670b0
EXSWHTEC-178 - Remove unnecessary code and fix memory leaks
nives-vukovic Dec 11, 2022
3dc0015
Merge branch 'utils' into hipGraphDependencies_tests
nives-vukovic Dec 11, 2022
669dc78
EXSWHTEC-173 - Add old version of each changed test file
nives-vukovic Dec 11, 2022
cc3c63e
EXSWHTEC-173 - Refactor code by using templates from added graph_depe…
nives-vukovic Dec 12, 2022
fd9a15d
EXSWHTEC-173 - Format files and add doxygen comments
nives-vukovic Dec 12, 2022
4113308
EXSWHTEC-173 - Disable tests that fail on AMD
nives-vukovic Dec 12, 2022
e19ad34
EXSWHTEC-173 - Disable additional test for AMD
nives-vukovic Dec 12, 2022
55b528b
EXSWHTEC-173 - Fix minor issues in tests
nives-vukovic Dec 13, 2022
f1c2732
Merge remote-tracking branch 'origin/develop' into hipGraphDependenci…
nives-vukovic Dec 13, 2022
f169a60
EXSWHTEC-145 - Change defect IDs
nives-vukovic Dec 13, 2022
2db594f
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 13, 2022
1977515
EXSWHTEC-200 - Resolve conflicts in missed conflicted files
milos-mozetic Dec 13, 2022
6101837
EXSWHTEC-198 - Update defect IDs
nives-vukovic Dec 13, 2022
4d48b5f
Merge remote-tracking branch 'origin/doxygen_configuration' into hipS…
nives-vukovic Dec 13, 2022
dd2db08
Merge remote-tracking branch 'origin/doxygen_configuration' into hipS…
nives-vukovic Dec 13, 2022
cb06a9f
Merge remote-tracking branch 'origin/develop' into hipEventNode_tests
nives-vukovic Dec 14, 2022
259be27
EXSWHTEC-200 - Add newline at the end of the file
milos-mozetic Dec 14, 2022
e0daf30
EXSWHTEC-200 - Extend the PREDEFINED list to define all macro names t…
milos-mozetic Dec 14, 2022
c8eb213
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 16, 2022
16d46ee
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 16, 2022
e19598f
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 16, 2022
14833bc
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 21, 2022
38b0f1f
Merge branch 'doxygen_configuration' of github.com:mirza-halilcevic/h…
milos-mozetic Dec 21, 2022
0d84c74
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 21, 2022
f281947
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Dec 21, 2022
40f7a6c
Merge branch 'doxygen_configuration' of github.com:mirza-halilcevic/h…
milos-mozetic Dec 21, 2022
68f293f
Merge branch 'doxygen_configuration' of github.com:mirza-halilcevic/h…
milos-mozetic Dec 21, 2022
151889e
Merge branch 'doxygen_configuration' of github.com:mirza-halilcevic/h…
milos-mozetic Dec 21, 2022
b67e855
Merge branch 'hipGraphKernelNode_tests' of github.com:mirza-halilcevi…
milos-mozetic Dec 21, 2022
0d4b905
Merge branch 'hipGraphKernelNodeSetGetAttribute_tests' of github.com:…
milos-mozetic Dec 21, 2022
e826b9c
Merge branch 'hipGraphHostNode_tests' of github.com:mirza-halilcevic/…
milos-mozetic Dec 21, 2022
564f187
Merge branch 'hipStreamCaptureInfo_tests' of github.com:mirza-halilce…
milos-mozetic Dec 21, 2022
b940c69
Merge branch 'hipStreamCapture_tests' of github.com:mirza-halilcevic/…
milos-mozetic Dec 21, 2022
b82853c
Merge branch 'hipGraphMemsetNode_tests' of github.com:mirza-halilcevi…
milos-mozetic Dec 21, 2022
c18b2e8
Merge branch 'hipGraphMemcpyNodeToFromSymbol_tests' of github.com:mir…
milos-mozetic Dec 21, 2022
96010fb
Merge branch 'hipGraphMemcpyNode1D_tests' of github.com:mirza-halilce…
milos-mozetic Dec 21, 2022
5280b19
Merge branch 'hipUserObject_tests' of github.com:mirza-halilcevic/hip…
milos-mozetic Dec 21, 2022
620338f
Merge branch 'hipGraphCreationAndDestruction_tests' of github.com:mir…
milos-mozetic Dec 21, 2022
ff923ca
Merge branch 'hipGraphLaunchingAndExecution_tests' of github.com:mirz…
milos-mozetic Dec 21, 2022
e7bba3d
Merge branch 'hipEventNode_tests' of github.com:mirza-halilcevic/hip-…
milos-mozetic Dec 21, 2022
872a9ab
Merge branch 'hipGraphMemcpyNode_tests' of github.com:mirza-halilcevi…
milos-mozetic Dec 21, 2022
64084c3
Merge branch 'hipGraphDependencies_tests' of github.com:mirza-halilce…
milos-mozetic Dec 21, 2022
3b96c84
EXSWHTEC-224 - Test cases ID clean up and documentation for Graph Man…
milos-mozetic Dec 23, 2022
73674a4
Merge branch 'develop' into doxygen_graph_management_documentation
milos-mozetic Dec 23, 2022
734da4b
EXSWHTEC-224 - Add warning message for hipGraphUpload
milos-mozetic Dec 23, 2022
5d15818
Merge branch 'doxygen_graph_management_documentation' of github.com:m…
milos-mozetic Dec 23, 2022
42c8185
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Jun 22, 2023
bd81e7b
Merge branch 'develop' of github.com:mirza-halilcevic/hip-tests into …
milos-mozetic Jul 10, 2023
b8d9669
Merge remote-tracking branch 'origin/develop' into doxygen_graph_mana…
nives-vukovic Feb 8, 2024
588ba5d
EXSWHTEC-224 - Cleanup of doxygen comments
nives-vukovic Feb 8, 2024
66314b6
EXSWHTEC-224 - Further cleanup of doxygen comments
nives-vukovic Feb 8, 2024
dda18c6
EXSWHTEC-224 - Cleanup of GraphDestroy doxygen comments
nives-vukovic Feb 8, 2024
e1531b6
EXSWHTEC-224 - Cleanup of Graph doxygen comments
nives-vukovic Feb 8, 2024
2304d7f
Merge branch 'develop' into doxygen_graph_management_documentation
mirza-halilcevic Feb 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions catch/unit/graph/hipGraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

/**
Testcase Scenarios :
1) Execution Without HIPGraphs : Regular procedure of using stream with async api calls.
2) Manual HIPGraph : Manual procedure of adding nodes to graphs and mapping dependencies.
3) HIPGraphs Using StreamCapture : Capturing sequence of operations in stream and launching
graph with the nodes automatically added.
*/

#include <hip_test_common.hh>

/**
* @addtogroup hipGraphCreate hipGraphCreate
* @{
* @ingroup GraphTest
*/

#define THREADS_PER_BLOCK 512
#define GRAPH_LAUNCH_ITERATIONS 1000

Expand Down Expand Up @@ -65,9 +63,7 @@ static void init_input(float* a, size_t size) {
}
}

/**
* Regular procedure of using stream with async api calls
*/
// Regular procedure of using stream with async api calls
static void hipWithoutGraphs(float* inputVec_h, float* inputVec_d,
double* outputVec_d, double* result_d, size_t inputSize, size_t numOfBlocks) {
hipStream_t stream1, stream2, stream3;
Expand Down Expand Up @@ -116,10 +112,10 @@ static void hipWithoutGraphs(float* inputVec_h, float* inputVec_d,
REQUIRE(result_h_cpu == result_h);
}

/**
* Capturing sequence of operations in stream and launching graph
* with the nodes automatically added.
*/
/*
Capturing sequence of operations in stream and launching graph
with the nodes automatically added.
*/
static void hipGraphsUsingStreamCapture(float* inputVec_h, float* inputVec_d,
double* outputVec_d, double* result_d,
size_t inputSize, size_t numOfBlocks) {
Expand Down Expand Up @@ -197,9 +193,7 @@ static void hipGraphsUsingStreamCapture(float* inputVec_h, float* inputVec_d,
REQUIRE(result_h_cpu == result_h);
}

/**
* Manual procedure of adding nodes to graphs and mapping dependencies.
*/
// Manual procedure of adding nodes to graphs and mapping dependencies.
static void hipGraphsManual(float* inputVec_h, float* inputVec_d,
double* outputVec_d, double* result_d, size_t inputSize,
size_t numOfBlocks) {
Expand Down Expand Up @@ -304,8 +298,18 @@ static void hipGraphsManual(float* inputVec_h, float* inputVec_d,
}

/**
* Tests basic functionality of hipGraph APIs by
* Execution Without HIPGraphs, Manual HIPGraph, HIPGraphs Using StreamCapture.
* Test Description
* ------------------------
* - Validates several basic Graph functionalities:
* -# Execution without Graphs: regular procedure of using stream with async API calls.
* -# Manual Graphs: manual procedure of adding nodes to graphs and adding dependencies.
* -# Graphs using Stream Capture: capturing sequence of operations in stream and launching.
* Test source
* ------------------------
* - unit/graph/hipGraph.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraph_BasicFunctional") {
constexpr size_t size = 1 << 12;
Expand Down
172 changes: 94 additions & 78 deletions catch/unit/graph/hipGraphAddChildGraphNode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,65 +17,41 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

/**
Testcase Scenarios of hipGraphAddChildGraphNode API:

Functional:
1. Create child graph as root node and execute the main graph.
2. Create multiple child graph nodes and check the behaviour.
3. Clone the child graph node, Add new nodes and execute the cloned graph.
4. Create child graph, add it to main graph and execute child graph.
5. Pass original graph as child graph and execute the org graph.
6. This test case verifies nested graph functionality. Parent graph
containing child graph, which in turn, contains another child graph.
Execute the graph in loop taking random input data and Validate the
output in each iteration.
7. This test case verifies clones the nested graph created in scenario6.
Execute the cloned graph in loop taking random input data and Validate
the output in each iteration.
8. Verify if an empty graph can be added as child node.
9. Create the nested graph of scenario6 and update the property of add kernel
node (innermost graph) with subtract kernel functionality. Clone the graph.
Execute both the updated graph.
10. The updated nested graph in 9 is cloned and the cloned graph is then
executed and the result is validated.
11. Create the nested graph of 6 and update the block size and grid size
property of add kernel node.
12. Create the nested graph of 6 and delete the add kernel node
(innermost graph) and add a subtract kernel node.
13. The updated nested graph in 12 is cloned and the cloned graph is then
executed and the result is validated.
14. Create the nested graph of 6 and delete the add kernel node
(innermost graph), add a child graph that contains an event record node,
a subtract kernel node followed by another event record node. Clone the
graph. Execute both the original and cloned graph.
15. The updated nested graph in 14 is cloned and the cloned graph is then
executed and the result is validated.
16. Create one nested graph per GPU context. Execute all the created graphs
in their respective GPUs and validate the output.
17. Functional Test to use child node as barrier to wait for multiple nodes.
This test uses child nodes to resolve dependencies between graphs. 4
graphs are created. Graph1 contains 3 independent memcpy h2d nodes, graph2
contains 3 independent kernel nodes and graph3 contains 3 independent
memcpy d2h nodes. Graph1, graph2 and graph3 are added as child nodes in
graph4. Graph4 is validated for functionality.

Negative:
1. Pass nullptr to graph node
2. Pass nullptr to graph
3. Pass invalid number of numDepdencies
4. Pass nullptr to child graph
*/

#include <hip_test_common.hh>
#include <hip_test_checkers.hh>
#include <hip_test_kernels.hh>

#define TEST_LOOP_SIZE 50
/*
This testcase verifies the negative scenarios of
hipGraphAddChildGraphNode API
*/

/**
* @addtogroup hipGraphAddChildGraphNode hipGraphAddChildGraphNode
* @{
* @ingroup GraphTest
* `hipGraphAddChildGraphNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
* const hipGraphNode_t* pDependencies, size_t numDependencies,
* hipGraph_t childGraph)` -
* Creates a child graph node and adds it to a graph.
*/

/**
* Test Description
* ------------------------
* - Validates handling of invalid arguments:
* -# When graph node pointer is `nullptr`
* - Expected output: return `hipErrorInvalidValue`
* -# When graph handle is `nullptr`
* - Expected output: return `hipErrorInvalidValue`
* -# When child graph handle is `nullptr`
* - Expected output: return `hipErrorInvalidValue`
* -# When dependencies pointer is `nullptr` and number is not valid
* - Expected output: return `hipErrorInvalidValue`
* Test source
* ------------------------
* - unit/graph/hipGraphAddChildGraphNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphAddChildGraphNode_Negative") {
constexpr size_t N = 1024;
constexpr size_t Nbytes = N * sizeof(int);
Expand All @@ -93,7 +69,7 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_Negative") {
0, A_h, B_d,
Nbytes, hipMemcpyDeviceToHost));

SECTION("Pass nullptr to graph noe") {
SECTION("Pass nullptr to graph node") {
REQUIRE(hipGraphAddChildGraphNode(nullptr, graph,
nullptr, 0, childgraph1)
== hipErrorInvalidValue);
Expand All @@ -111,18 +87,26 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_Negative") {
== hipErrorInvalidValue);
}

SECTION("Pass invalid depdencies") {
SECTION("Pass invalid dependencies") {
REQUIRE(hipGraphAddChildGraphNode(&childGraphNode1, graph,
nullptr, 10, childgraph1)
== hipErrorInvalidValue);
}
}

/*
This testcase verifies the following scenario
Creates the graph, add the graph as a child node
and verify the number of the nodes in the original graph
*/
/**
* Test Description
* ------------------------
* - Creates the graph.
* - Adds the graph as a child node.
* - Verifies the number of the nodes in the original graph.
* Test source
* ------------------------
* - unit/graph/hipGraphAddChildGraphNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphAddChildGraphNode_OrgGraphAsChildGraph") {
constexpr size_t N = 1024;
constexpr size_t Nbytes = N * sizeof(int);
Expand Down Expand Up @@ -160,11 +144,19 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_OrgGraphAsChildGraph") {
HIP_CHECK(hipStreamDestroy(streamForGraph));
}

/*
This testcase verifies the following scenario
Create graph, Add child nodes to the graph and execute only the
child graph node and verify the behaviour
*/
/**
* Test Description
* ------------------------
* - Creates a graph.
* - Adds child nodes to the graph.
* - Executes only the child graphs and verifies the behaviour.
* Test source
* ------------------------
* - unit/graph/hipGraphAddChildGraphNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphAddChildGraphNode_ExecuteChildGraph") {
constexpr size_t N = 1024;
constexpr size_t Nbytes = N * sizeof(int);
Expand Down Expand Up @@ -217,11 +209,19 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_ExecuteChildGraph") {
HIP_CHECK(hipStreamDestroy(streamForGraph));
}

/*
This testcase verifies the following scenario
creates graph, Add child nodes to graph, clone the graph and execute
the cloned graph
*/
/**
* Test Description
* ------------------------
* - Creates the graphs.
* - Adds child nodes to graph.
* - Clones the graphs and executes the cloned graph.
* Test source
* ------------------------
* - unit/graph/hipGraphAddChildGraphNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphAddChildGraphNode_CloneChildGraph") {
constexpr size_t N = 1024;
constexpr size_t Nbytes = N * sizeof(int);
Expand Down Expand Up @@ -271,11 +271,18 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_CloneChildGraph") {
HIP_CHECK(hipStreamDestroy(streamForGraph));
}

/*
This testcase verifies the following scenario
Create graph, add multiple child nodes and validates the
behaviour
*/
/**
* Test Description
* ------------------------
* - Creates the graph.
* - Adds multiple child nodes and validates the behaviour.
* Test source
* ------------------------
* - unit/graph/hipGraphAddChildGraphNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphAddChildGraphNode_MultipleChildNodes") {
constexpr size_t N = 1024;
constexpr size_t Nbytes = N * sizeof(int);
Expand Down Expand Up @@ -344,9 +351,18 @@ TEST_CASE("Unit_hipGraphAddChildGraphNode_MultipleChildNodes") {
HIP_CHECK(hipGraphDestroy(graph));
HIP_CHECK(hipStreamDestroy(streamForGraph));
}

/**
This testcase verifies hipGraphAddChildGraphNode functionality
where root node is the child node.
* Test Description
* ------------------------
* - Create child graph as root node.
* - Execute the main graph.
* Test source
* ------------------------
* - unit/graph/hipGraphAddChildGraphNode.cc
* Test requirements
* ------------------------
* - HIP_VERSION >= 5.2
*/
TEST_CASE("Unit_hipGraphAddChildGraphNode_SingleChildNode") {
constexpr size_t N = 1024;
Expand Down
Loading