Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion gloo/test/cuda_base_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ void cudaSleep(cudaStream_t stream, size_t clocks) {

int cudaNumDevices() {
int n = 0;
CUDA_CHECK(cudaGetDeviceCount(&n));
auto err = cudaGetDeviceCount(&n);
if (err != cudaSuccess) {
// Return 1 as fallback so INSTANTIATE_TEST_CASE_P can register tests
// during listing on machines without GPUs. Tests will fail at runtime
// if GPUs are actually needed.
return 1;
}
return n;
}

Expand Down
Loading