From 9d402c111cbaa9c5a48d64963cf35779ccf275bf Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Thu, 10 Mar 2022 15:01:43 +0530 Subject: [PATCH] Add mising p2p checks in graph instantiate tests (#2525) Change-Id: I37ed539ccb9fc487872807170dc62eddc598f1f6 [ROCm/hip commit: 69ef2e37a2128d45127b1def6dba644cd085bffd] --- .../graph/hipGraphInstantiateWithFlags.cc | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/projects/hip/tests/catch/unit/graph/hipGraphInstantiateWithFlags.cc b/projects/hip/tests/catch/unit/graph/hipGraphInstantiateWithFlags.cc index b8fabb69ee..5e53d0357c 100644 --- a/projects/hip/tests/catch/unit/graph/hipGraphInstantiateWithFlags.cc +++ b/projects/hip/tests/catch/unit/graph/hipGraphInstantiateWithFlags.cc @@ -248,7 +248,19 @@ by creating dependency graph and instantiate, launching and verifying the result */ TEST_CASE("Unit_hipGraphInstantiateWithFlags_DependencyGraph") { - GraphInstantiateWithFlags_DependencyGraph(); + int numDevices = 0; + int canAccessPeer = 0; + HIP_CHECK(hipGetDeviceCount(&numDevices)); + if (numDevices > 1) { + HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); + if (canAccessPeer) { + GraphInstantiateWithFlags_DependencyGraph(); + } else { + SUCCEED("Machine does not seem to have P2P"); + } + } else { + SUCCEED("skipped the testcase as no of devices is less than 2"); + } } /* This testcase verifies hipGraphInstantiateWithFlags API @@ -278,7 +290,19 @@ by creating capture graph and instantiate, launching and verifying the result */ TEST_CASE("Unit_hipGraphInstantiateWithFlags_StreamCapture") { - GraphInstantiateWithFlags_StreamCapture(); + int numDevices = 0; + int canAccessPeer = 0; + HIP_CHECK(hipGetDeviceCount(&numDevices)); + if (numDevices > 1) { + HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); + if (canAccessPeer) { + GraphInstantiateWithFlags_StreamCapture(); + } else { + SUCCEED("Machine does not seem to have P2P"); + } + } else { + SUCCEED("skipped the testcase as no of devices is less than 2"); + } } /*