From 988dead07bcc46f0db753e69883a0f1e3a0af362 Mon Sep 17 00:00:00 2001 From: Ahmed Mahmoud Date: Thu, 7 Jul 2022 15:39:43 -0400 Subject: [PATCH] Fix github action failed test --- libNeonDomain/tests/unit/domainUt_swap/src/Swap.cu | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libNeonDomain/tests/unit/domainUt_swap/src/Swap.cu b/libNeonDomain/tests/unit/domainUt_swap/src/Swap.cu index e456366c..1eb085eb 100644 --- a/libNeonDomain/tests/unit/domainUt_swap/src/Swap.cu +++ b/libNeonDomain/tests/unit/domainUt_swap/src/Swap.cu @@ -104,11 +104,15 @@ void SwapContainerRun(TestData& data) namespace { int getNGpus() { - int maxGPUs = Neon::set::DevSet::maxSet().setCardinality(); - if (maxGPUs > 1) { - return maxGPUs; + if (Neon::sys::globalSpace::gpuSysObjStorage.numDevs() > 0) { + int maxGPUs = Neon::set::DevSet::maxSet().setCardinality(); + if (maxGPUs > 1) { + return maxGPUs; + } else { + return 3; + } } else { - return 3; + return 0; } } } // namespace