Skip to content

Commit 8c20237

Browse files
leofangemcastilloclaude
committed
Use except?-1 for sync_torch_stream instead of except*
Co-Authored-By: Emilio Castillo <ecastillo@nvidia.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0c31df1 commit 8c20237

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cuda_core/cuda/core/_tensor_bridge.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ cdef int _get_aoti_itemsize(int32_t dtype_code) except -1:
204204
# Stream ordering helper
205205
# ---------------------------------------------------------------------------
206206

207-
cpdef void sync_torch_stream(int32_t device_index,
208-
intptr_t consumer_s) except *:
207+
cpdef int sync_torch_stream(int32_t device_index,
208+
intptr_t consumer_s) except? -1:
209209
"""Establish stream ordering between PyTorch's current CUDA stream
210210
and the given consumer stream.
211211
@@ -226,6 +226,7 @@ cpdef void sync_torch_stream(int32_t device_index,
226226
as_cu(h_event), <cydriver.CUstream>producer_s))
227227
HANDLE_RETURN(cydriver.cuStreamWaitEvent(
228228
<cydriver.CUstream>consumer_s, as_cu(h_event), 0))
229+
return 0
229230

230231

231232
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)