Skip to content

Commit 6aa629f

Browse files
committed
add docstring saying HANDLE_RETURN adds CUresult message into CUDAError so that the message is not swallowed by RuntimeError
1 parent 35e7b74 commit 6aa629f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎cuda_core/cuda/core/graph/_graph_builder.pyx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def _instantiate_graph(source, options: GraphCompleteOptions | None = None) -> G
212212
h_exec = create_graph_exec_handle(h_graph, &params)
213213
status = get_last_error()
214214
if params.result_out == driver.CUgraphInstantiateResult.CUDA_GRAPH_INSTANTIATE_ERROR:
215-
# HANDLE_RETURN raises CUDAError when status is not CUDA_SUCCESS.
215+
# HANDLE_RETURN raises CUDAError with the CUresult name and message (e.g. CUDA_ERROR_INVALID_VALUE)
216+
# when status is not CUDA_SUCCESS.
216217
HANDLE_RETURN(status)
217218
raise RuntimeError(
218219
"Instantiation failed for an unexpected reason which is described in the return value of the function."

0 commit comments

Comments
 (0)