@@ -225,7 +225,13 @@ def test_graph_conditional_if(init_cuda, condition_value):
225225 gb = Device ().create_graph_builder ().begin_building ()
226226
227227 # Add Node A (sets condition)
228- handle = gb .create_conditional_handle ()
228+ try :
229+ handle = gb .create_conditional_handle ()
230+ except RuntimeError as e :
231+ with pytest .raises (RuntimeError , match = "^Driver version \d+ does not support conditional handles" ):
232+ raise e
233+ gb .end_building ()
234+ pytest .skip ("Driver does not support conditional handle" )
229235 launch (gb , LaunchConfig (grid = 1 , block = 1 ), set_handle , handle , condition_value )
230236
231237 # # Add Node B (if condition)
@@ -283,7 +289,7 @@ def test_graph_conditional_if_else(init_cuda, condition_value):
283289 try :
284290 gb_if , gb_else = gb .if_else (handle )
285291 except RuntimeError as e :
286- with pytest .raises (RuntimeError , match = "does not support conditional" ):
292+ with pytest .raises (RuntimeError , match = "^Driver version \d+ does not support conditional if-else " ):
287293 raise e
288294 gb .end_building ()
289295 pytest .skip ("Driver does not support conditional if-else" )
@@ -351,7 +357,7 @@ def test_graph_conditional_switch(init_cuda, condition_value):
351357 try :
352358 gb_case = list (gb .switch (handle , 3 ))
353359 except RuntimeError as e :
354- with pytest .raises (RuntimeError , match = "does not support conditional" ):
360+ with pytest .raises (RuntimeError , match = "^Driver version \d+ does not support conditional switch " ):
355361 raise e
356362 gb .end_building ()
357363 pytest .skip ("Driver does not support conditional switch" )
@@ -485,7 +491,7 @@ def test_graph_child_graph(init_cuda):
485491 except NotImplementedError as e :
486492 with pytest .raises (
487493 NotImplementedError ,
488- match = "^Launching child graphs is not implemented for versions older than CUDA 12. Found driver version is " ,
494+ match = "^Launching child graphs is not implemented for versions older than CUDA 12" ,
489495 ):
490496 raise e
491497 gb_parent .end_building ()
@@ -528,7 +534,7 @@ def build_graph(condition_value):
528534 try :
529535 gb_case = list (gb .switch (handle , 3 ))
530536 except RuntimeError as e :
531- with pytest .raises (RuntimeError , match = "does not support conditional" ):
537+ with pytest .raises (RuntimeError , match = "^Driver version \d+ does not support conditional switch " ):
532538 raise e
533539 gb .end_building ()
534540 pytest .skip ("Driver does not support conditional switch" )
0 commit comments