Skip to content

Commit 6283221

Browse files
committed
add test_graph_complete_invalid_options_raise_cuda_error per review comment
1 parent a2164d5 commit 6283221

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎cuda_core/tests/graph/test_options.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from helpers.graph_kernels import compile_common_kernels, compile_conditional_kernels
88

99
from cuda.core import Device, LaunchConfig, launch
10+
from cuda.core._utils.cuda_utils import CUDAError
1011
from cuda.core.graph import GraphBuilder, GraphCompleteOptions, GraphDebugPrintOptions
1112

1213

@@ -65,6 +66,20 @@ def test_graph_complete_options(init_cuda):
6566
gb.complete(options).close()
6667

6768

69+
@pytest.mark.agent_authored(model="gpt-5.6")
70+
def test_graph_complete_invalid_options_raise_cuda_error(init_cuda):
71+
mod = compile_common_kernels()
72+
empty_kernel = mod.get_kernel("empty_kernel")
73+
74+
gb = Device().create_graph_builder().begin_building()
75+
launch(gb, LaunchConfig(grid=1, block=1), empty_kernel)
76+
gb.end_building()
77+
78+
options = GraphCompleteOptions(auto_free_on_launch=True, device_launch=True)
79+
with pytest.raises(CUDAError, match="CUDA_ERROR_INVALID_VALUE"):
80+
gb.complete(options)
81+
82+
6883
def test_graph_build_mode(init_cuda):
6984
mod = compile_common_kernels()
7085
empty_kernel = mod.get_kernel("empty_kernel")

0 commit comments

Comments
 (0)