Skip to content

Commit

Permalink
Fix github action failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdhn committed Jul 7, 2022
1 parent 8aba020 commit 988dead
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libNeonDomain/tests/unit/domainUt_swap/src/Swap.cu
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,15 @@ void SwapContainerRun(TestData<G, T, C>& 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
Expand Down

0 comments on commit 988dead

Please sign in to comment.