Skip to content

Commit f3f8a43

Browse files
committed
Add missing #ifdef
1 parent 184bdf1 commit f3f8a43

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/libtorch.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,13 +2276,15 @@ void
22762276
ModelInstanceState::SetCurrentCudaStream(
22772277
const cudaStream_t& stream, const int& device_id)
22782278
{
2279+
#ifdef TRITON_ENABLE_GPU
22792280
at::cuda::CUDAStream torch_stream =
22802281
at::cuda::getStreamFromExternal(stream, device_id);
22812282
// This function replaces the default stream with the stream we created. It
22822283
// is not necessary to change the current device to the desired device when
22832284
// replacing the default stream for that device. See the documentation here:
22842285
// https://pytorch.org/cppdocs/api/function_namespacec10_1_1cuda_1a6ed50cc0fc16cc7014d9c2f4c3bd098d.html
22852286
at::cuda::setCurrentCUDAStream(torch_stream);
2287+
#endif
22862288
}
22872289

22882290
/////////////

0 commit comments

Comments
 (0)