From 2b68ab02ca3b176e0d93a49cfdac56c24fa6b4bb Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Thu, 29 Jun 2023 08:58:35 +0530 Subject: [PATCH] SWDEV-396615 - check for managed memory support (#323) Change-Id: Ib8afef16ac90489c08c761b2a2ce34c1ba671e6b [ROCm/hip-tests commit: 0498738189c2b0bb77abc54f20da7336a27f90d7] --- .../catch/TypeQualifiers/hipManagedKeyword.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/projects/hip-tests/catch/TypeQualifiers/hipManagedKeyword.cc b/projects/hip-tests/catch/TypeQualifiers/hipManagedKeyword.cc index 4d6a97b119..9221372992 100644 --- a/projects/hip-tests/catch/TypeQualifiers/hipManagedKeyword.cc +++ b/projects/hip-tests/catch/TypeQualifiers/hipManagedKeyword.cc @@ -67,6 +67,17 @@ TEST_CASE("Unit_hipManagedKeyword_MultiGpu") { int numDevices = 0; HIP_CHECK(hipGetDeviceCount(&numDevices)); + for (int i = 0; i < numDevices; i++){ + int managed_memory = 0; + HIPCHECK(hipDeviceGetAttribute(&managed_memory, + hipDeviceAttributeManagedMemory, + i)); + if (!managed_memory) { + HipTest::HIP_SKIP_TEST("managed memory access not supported on device"); + return; + } + } + for (int i = 0; i < numDevices; i++) { HIP_CHECK(hipSetDevice(i)); GPU_func<<< 1, 1 >>>();