Skip to content

Commit c7ce715

Browse files
committed
Catch dmlc::Error.
Fix dmlc#3643.
1 parent efc4f85 commit c7ce715

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/common/common.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int AllVisibleImpl::AllVisible() {
1111
// When compiled with CUDA but running on CPU only device,
1212
// cudaGetDeviceCount will fail.
1313
dh::safe_cuda(cudaGetDeviceCount(&n_visgpus));
14-
} catch(const thrust::system::system_error& err) {
14+
} catch(const dmlc::Error &except) {
1515
return 0;
1616
}
1717
return n_visgpus;

src/common/device_helpers.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ class SaveCudaContext {
956956
// cudaGetDevice will fail.
957957
try {
958958
safe_cuda(cudaGetDevice(&saved_device_));
959-
} catch (const thrust::system::system_error & err) {
959+
} catch (const dmlc::Error &except) {
960960
saved_device_ = -1;
961961
}
962962
func();

0 commit comments

Comments
 (0)