diff --git a/projects/hip-tests/catch/unit/memory/hipMemcpyDtoD.cc b/projects/hip-tests/catch/unit/memory/hipMemcpyDtoD.cc index 77e94d1cff..7f93fff4f1 100644 --- a/projects/hip-tests/catch/unit/memory/hipMemcpyDtoD.cc +++ b/projects/hip-tests/catch/unit/memory/hipMemcpyDtoD.cc @@ -50,11 +50,12 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyDtoD_Basic", "[multigpu]", int, float, int canAccessPeer = 0; HIP_CHECK(hipDeviceCanAccessPeer(&canAccessPeer, 0, 1)); HIP_CHECK(hipSetDevice(0)); - if (canAccessPeer) { - HIP_CHECK(hipDeviceEnablePeerAccess(1, 0)); - } else { - INFO("Machine does not have P2P Capabilities"); + if (!canAccessPeer) { + std::string msg = "Device is not capable of directly accessing memory from peerDevice. Skipping the test."; + HipTest::HIP_SKIP_TEST(msg.c_str()); + return; } + HIP_CHECK(hipDeviceEnablePeerAccess(1, 0)); HipTest::initArrays(&A_d, &B_d, &C_d, &A_h, &B_h, &C_h, NUM_ELM, false); HIP_CHECK(hipSetDevice(1)); HIP_CHECK(hipMalloc(&X_d, Nbytes)); @@ -90,9 +91,9 @@ TEMPLATE_TEST_CASE("Unit_hipMemcpyDtoD_Basic", "[multigpu]", int, float, HipTest::checkVectorADD(A_h, B_h, C_h, NUM_ELM); } - HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); HIP_CHECK(hipFree(X_d)); HIP_CHECK(hipFree(Y_d)); HIP_CHECK(hipFree(Z_d)); } + HipTest::freeArrays(A_d, B_d, C_d, A_h, B_h, C_h, false); }