Skip to content

Commit 988dead

Browse files
committed
Fix github action failed test
1 parent 8aba020 commit 988dead

File tree

1 file changed

+8
-4
lines changed
  • libNeonDomain/tests/unit/domainUt_swap/src

1 file changed

+8
-4
lines changed

libNeonDomain/tests/unit/domainUt_swap/src/Swap.cu

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,15 @@ void SwapContainerRun(TestData<G, T, C>& data)
104104
namespace {
105105
int getNGpus()
106106
{
107-
int maxGPUs = Neon::set::DevSet::maxSet().setCardinality();
108-
if (maxGPUs > 1) {
109-
return maxGPUs;
107+
if (Neon::sys::globalSpace::gpuSysObjStorage.numDevs() > 0) {
108+
int maxGPUs = Neon::set::DevSet::maxSet().setCardinality();
109+
if (maxGPUs > 1) {
110+
return maxGPUs;
111+
} else {
112+
return 3;
113+
}
110114
} else {
111-
return 3;
115+
return 0;
112116
}
113117
}
114118
} // namespace

0 commit comments

Comments
 (0)