Skip to content

Commit

Permalink
Check.
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Mar 24, 2021
1 parent 80f79dc commit f3fe1d9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/data/array_interface.cu
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@

namespace xgboost {
void ArrayInterfaceHandler::SyncCudaStream(int64_t stream) {
dh::safe_cuda(cudaStreamSynchronize(reinterpret_cast<cudaStream_t>(stream)));
switch (stream) {
case 0:
LOG(FATAL) << "Invalid stream ID in array interface: " << stream;
case 1:
// default legacy stream
break;
case 2:
// default per-thread stream
default:
dh::safe_cuda(cudaStreamSynchronize(reinterpret_cast<cudaStream_t>(stream)));
}
}
} // namespace xgboost

0 comments on commit f3fe1d9

Please sign in to comment.