From bcd84a52016b7596e37a9f1910f7d9270f2a4c86 Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Mon, 3 Apr 2023 17:38:56 +0100 Subject: [PATCH] SWDEV-391727 - Unit_hipMemRangeGetAttribute_TstCountParam Recreation of github PR https://github.com/ROCm-Developer-Tools/hip-tests/pull/399 Change-Id: I80c11d549b4f6e66ecea2b676d32fba9d7929e49 [ROCm/hip-tests commit: ab80259b3ccea2258a7161898b0b3d774838c982] --- .../unit/memory/hipMemRangeGetAttribute_old.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/projects/hip-tests/catch/unit/memory/hipMemRangeGetAttribute_old.cc b/projects/hip-tests/catch/unit/memory/hipMemRangeGetAttribute_old.cc index 64fc8e6be4..c8194a4b98 100644 --- a/projects/hip-tests/catch/unit/memory/hipMemRangeGetAttribute_old.cc +++ b/projects/hip-tests/catch/unit/memory/hipMemRangeGetAttribute_old.cc @@ -91,6 +91,19 @@ static int HmmAttrPrint() { TEST_CASE("Unit_hipMemRangeGetAttribute_TstCountParam") { int MangdMem = HmmAttrPrint(); if (MangdMem == 1) { + + #if HT_AMD + int isPageableHMM = 0; + HIP_CHECK(hipDeviceGetAttribute(&isPageableHMM, + hipDeviceAttributePageableMemoryAccess, 0)); + if (!isPageableHMM) { + SUCCEED("Running on a system where all the memory requested in hipMallocManaged " + "is allocated on the host.\nThis can cause instability because of out-of-memory failures.\n" + "Hence skipping the test with Pass result.\n"); + return; + } + #endif + int MEM_SIZE = 4096, RND_NUM = 9999, FLG_READMOSTLY_ENBLD = 1; bool IfTestPassed = true; int data = RND_NUM, *devPtr = nullptr;