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