Skip to content

Commit

Permalink
Catch dmlc::Error. (#3751)
Browse files Browse the repository at this point in the history
Fix #3643.
  • Loading branch information
trivialfis authored and RAMitchell committed Oct 4, 2018
1 parent efc4f85 commit c6b5df6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/common.cu
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int AllVisibleImpl::AllVisible() {
// When compiled with CUDA but running on CPU only device,
// cudaGetDeviceCount will fail.
dh::safe_cuda(cudaGetDeviceCount(&n_visgpus));
} catch(const thrust::system::system_error& err) {
} catch(const dmlc::Error &except) {
return 0;
}
return n_visgpus;
Expand Down
2 changes: 1 addition & 1 deletion src/common/device_helpers.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ class SaveCudaContext {
// cudaGetDevice will fail.
try {
safe_cuda(cudaGetDevice(&saved_device_));
} catch (const thrust::system::system_error & err) {
} catch (const dmlc::Error &except) {
saved_device_ = -1;
}
func();
Expand Down

0 comments on commit c6b5df6

Please sign in to comment.