From eaacaa7efb63e3cbbed1ff74253c2956bc306f08 Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Thu, 10 Aug 2023 13:54:01 +0000 Subject: [PATCH] SWDEV-415174 - Skip if access to host is not supported. Change-Id: Ib7254d3f43e6cb158e188d53f16473ba8d3a2e26 --- catch/unit/memory/hipMemCoherencyTst.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/catch/unit/memory/hipMemCoherencyTst.cc b/catch/unit/memory/hipMemCoherencyTst.cc index ce1fbdaed..2a85a8361 100644 --- a/catch/unit/memory/hipMemCoherencyTst.cc +++ b/catch/unit/memory/hipMemCoherencyTst.cc @@ -220,8 +220,14 @@ TEST_CASE("Unit_hipExtMallocWithFlags_CoherentTst") { if (managed == 1 && Pageable == 1) { // Allocating hipExtMallocWithFlags() memory with flags SECTION("hipExtMallocWithFlags with hipDeviceMallocFinegrained flag") { - HIP_CHECK(hipExtMallocWithFlags(reinterpret_cast(&Ptr), SIZE*2, + int dirAccess = 0; + HIP_CHECK(hipDeviceGetAttribute(&dirAccess, hipDeviceAttributeDirectManagedMemAccessFromHost, + 0)); + INFO("hipDeviceAttributeDirectManagedMemAccessFromHost: " << dirAccess); + if (dirAccess == 1) { + HIP_CHECK(hipExtMallocWithFlags(reinterpret_cast(&Ptr), SIZE*2, hipDeviceMallocFinegrained)); + } } SECTION("hipExtMallocWithFlags with hipDeviceMallocSignalMemory flag") { // for hipMallocSignalMemory flag the size of memory must be 8