Skip to content

Commit e0749b0

Browse files
committed
Resolve review comments about naming
1 parent 9a2d5f4 commit e0749b0

3 files changed

Lines changed: 14 additions & 20 deletions

File tree

cuda_core/cuda/core/experimental/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from cuda.core.experimental import utils
66
from cuda.core.experimental._device import Device
77
from cuda.core.experimental._event import Event, EventOptions
8-
from cuda.core.experimental._graph import CompleteOptions, DebugPrintOptions, Graph, GraphBuilder, launch_graph
8+
from cuda.core.experimental._graph import GraphCompleteOptions, GraphDebugPrintOptions, Graph, GraphBuilder, launch_graph
99
from cuda.core.experimental._launch_config import LaunchConfig
1010
from cuda.core.experimental._launcher import launch
1111
from cuda.core.experimental._linker import Linker, LinkerOptions

cuda_core/cuda/core/experimental/_graph.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _lazy_init():
3333

3434

3535
@dataclass
36-
class DebugPrintOptions:
36+
class GraphDebugPrintOptions:
3737
"""Customizable options for :obj:`_graph.GraphBuilder.debug_dot_print()`
3838
3939
Attributes
@@ -92,7 +92,7 @@ class DebugPrintOptions:
9292

9393

9494
@dataclass
95-
class CompleteOptions:
95+
class GraphCompleteOptions:
9696
"""Customizable options for :obj:`_graph.GraphBuilder.complete()`
9797
9898
Attributes
@@ -262,12 +262,12 @@ def end_building(self) -> GraphBuilder:
262262
self._building_ended = True
263263
return self
264264

265-
def complete(self, options: Optional[CompleteOptions] = None) -> Graph:
265+
def complete(self, options: Optional[GraphCompleteOptions] = None) -> Graph:
266266
"""Completes the graph builder and returns the built :obj:`~_graph.Graph` object.
267267
268268
Parameters
269269
----------
270-
options : :obj:`~_graph.CompleteOptions`, optional
270+
options : :obj:`~_graph.GraphCompleteOptions`, optional
271271
Customizable dataclass for the graph builder completion options.
272272
273273
Returns
@@ -324,14 +324,14 @@ def complete(self, options: Optional[CompleteOptions] = None) -> Graph:
324324
raise RuntimeError(f"Graph instantiation failed with unexpected error code: {params.result_out}")
325325
return graph
326326

327-
def debug_dot_print(self, path, options: Optional[DebugPrintOptions] = None):
327+
def debug_dot_print(self, path, options: Optional[GraphDebugPrintOptions] = None):
328328
"""Generates a DOT debug file for the graph builder.
329329
330330
Parameters
331331
----------
332332
path : str
333333
File path to use for writting debug DOT output
334-
options : :obj:`~_graph.DebugPrintOptions`, optional
334+
options : :obj:`~_graph.GraphDebugPrintOptions`, optional
335335
Customizable dataclass for the debug print options.
336336
337337
"""
@@ -768,12 +768,6 @@ def launch_graph(parent_graph: GraphBuilder, child_graph: GraphBuilder):
768768
if not parent_graph.is_building:
769769
raise ValueError("Parent graph is being built.")
770770

771-
status, _, graph_out, dependencies_out, num_dependencies_out = handle_return(
772-
driver.cuStreamGetCaptureInfo(parent_graph.stream.handle)
773-
)
774-
if status != driver.CUstreamCaptureStatus.CU_STREAM_CAPTURE_STATUS_ACTIVE:
775-
raise ValueError("Parent graph is not in an active capture state")
776-
777771
child_node = handle_return(
778772
driver.cuGraphAddChildGraphNode(graph_out, dependencies_out, num_dependencies_out, child_graph._mnff.graph)
779773
)

cuda_core/tests/test_graph.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
except ImportError:
1111
from cuda import nvrtc
1212
from cuda.core.experimental import (
13-
CompleteOptions,
14-
DebugPrintOptions,
13+
GraphCompleteOptions,
14+
GraphDebugPrintOptions,
1515
Device,
1616
GraphBuilder,
1717
LaunchConfig,
@@ -690,7 +690,7 @@ def test_graph_dot_print_options(init_cuda, tmp_path):
690690

691691
# Print using all options
692692
path = bytes(str(tmp_path / "vlad.dot"), "utf-8")
693-
options = DebugPrintOptions(**{field: True for field in DebugPrintOptions.__dataclass_fields__})
693+
options = GraphDebugPrintOptions(**{field: True for field in GraphDebugPrintOptions.__dataclass_fields__})
694694
gb.debug_dot_print(path, options)
695695

696696

@@ -706,13 +706,13 @@ def test_graph_complete_options(init_cuda):
706706
launch(gb, LaunchConfig(grid=1, block=1), empty_kernel)
707707
gb.end_building()
708708

709-
options = CompleteOptions(auto_free_on_launch=True)
709+
options = GraphCompleteOptions(auto_free_on_launch=True)
710710
gb.complete(options).close()
711-
options = CompleteOptions(upload_stream=launch_stream)
711+
options = GraphCompleteOptions(upload_stream=launch_stream)
712712
gb.complete(options).close()
713-
options = CompleteOptions(device_launch=True)
713+
options = GraphCompleteOptions(device_launch=True)
714714
gb.complete(options).close()
715-
options = CompleteOptions(use_node_priority=True)
715+
options = GraphCompleteOptions(use_node_priority=True)
716716
gb.complete(options).close()
717717

718718

0 commit comments

Comments
 (0)