From b73f77a75a2cf8b54e3003270dcf38e16bb61879 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 --- .../graph/hipGraphInstantiateWithFlags.cc | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/catch/unit/graph/hipGraphInstantiateWithFlags.cc b/catch/unit/graph/hipGraphInstantiateWithFlags.cc index b8fabb69ee..5e53d0357c 100644 --- a/catch/unit/graph/hipGraphInstantiateWithFlags.cc +++ b/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"); + } } /*