Skip to content

Commit fe04a91

Browse files
committed
Handle all cuGraphExecUpdate error codes, not just update failure
Check for CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE first to provide the rich error message with the update result reason, then fall through to HANDLE_RETURN for any other error code (CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_NOT_SUPPORTED, etc.) or success. Made-with: Cursor
1 parent e924fde commit fe04a91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cuda_core/cuda/core/_graph/_graph_builder.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,11 +817,11 @@ class Graph:
817817
cdef cydriver.CUresult err
818818
with nogil:
819819
err = cydriver.cuGraphExecUpdate(cu_exec, cu_graph, &result_info)
820-
if err != cydriver.CUresult.CUDA_SUCCESS:
821-
assert err == cydriver.CUresult.CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE
820+
if err == cydriver.CUresult.CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE:
822821
reason = driver.CUgraphExecUpdateResult(result_info.result)
823822
msg = f"Graph update failed: {reason.__doc__.strip()} ({reason.name})"
824823
raise CUDAError(msg)
824+
HANDLE_RETURN(err)
825825

826826
def upload(self, stream: Stream):
827827
"""Uploads the graph in a stream.

0 commit comments

Comments
 (0)