From d01cfbc1cc13550a6cc49f7e707b9b3135feaebe Mon Sep 17 00:00:00 2001 From: German Andryeyev Date: Mon, 26 Apr 2021 14:05:50 -0400 Subject: [PATCH] SWDEV-240804 - Check the managed capability Some system have HMM disabled. Check the capability before running the test. Change-Id: I098d04d87c12ec317b4cb57e121e702b6bba03bc [ROCm/clr commit: 17f32d450884879d6f1ffcb343334336d0ab3e5e] --- .../memory/hipMallocManaged_MultiScenario.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMallocManaged_MultiScenario.cpp b/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMallocManaged_MultiScenario.cpp index 38be3e29d0..8676706c53 100644 --- a/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMallocManaged_MultiScenario.cpp +++ b/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMallocManaged_MultiScenario.cpp @@ -368,8 +368,18 @@ int main(int argc, char* argv[]) { failed("Valid arguments are from 1 to 5"); } + int managed_memory = 0; + HIPCHECK(hipDeviceGetAttribute(&managed_memory, + hipDeviceAttributeManagedMemory, + p_gpuDevice)); + if (!managed_memory) { + printf("info: managed memory access not supported on device %d\n Skipped\n", p_gpuDevice); + passed(); + } + int NumDevices = 0; HIPCHECK(hipGetDeviceCount(&NumDevices)); + bool TestStatus = true, OverAllStatus = true; if (p_tests == 1) { TestStatus = TestMallocManaged1(NumDevices);