parent
efc4f85505
commit
c6b5df67f6
@ -11,7 +11,7 @@ int AllVisibleImpl::AllVisible() {
|
|||||||
// When compiled with CUDA but running on CPU only device,
|
// When compiled with CUDA but running on CPU only device,
|
||||||
// cudaGetDeviceCount will fail.
|
// cudaGetDeviceCount will fail.
|
||||||
dh::safe_cuda(cudaGetDeviceCount(&n_visgpus));
|
dh::safe_cuda(cudaGetDeviceCount(&n_visgpus));
|
||||||
} catch(const thrust::system::system_error& err) {
|
} catch(const dmlc::Error &except) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return n_visgpus;
|
return n_visgpus;
|
||||||
|
|||||||
@ -956,7 +956,7 @@ class SaveCudaContext {
|
|||||||
// cudaGetDevice will fail.
|
// cudaGetDevice will fail.
|
||||||
try {
|
try {
|
||||||
safe_cuda(cudaGetDevice(&saved_device_));
|
safe_cuda(cudaGetDevice(&saved_device_));
|
||||||
} catch (const thrust::system::system_error & err) {
|
} catch (const dmlc::Error &except) {
|
||||||
saved_device_ = -1;
|
saved_device_ = -1;
|
||||||
}
|
}
|
||||||
func();
|
func();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user