cuda.core.graph.Graph#

class cuda.core.graph.Graph#

An executable graph.

A graph groups a set of CUDA kernels and other CUDA operations together and executes them with a specified dependency tree. It speeds up the workflow by combining the driver activities associated with CUDA kernel launches and CUDA API calls.

Graphs must be built using a GraphBuilder object.

Methods

__init__(*args, **kwargs)#
close(self)#

Destroy the graph.

launch(self, Stream stream: Stream)#

Launches the graph in a stream.

Parameters:

stream (Stream) – The stream in which to launch the graph

update(self, source: 'GraphBuilder | GraphDefinition') None#

Update the graph using a new graph definition.

The topology of the provided source must be identical to this graph.

Parameters:

source (GraphBuilder or GraphDefinition) – The graph definition to update from. A GraphBuilder must have finished building.

upload(self, Stream stream: Stream)#

Uploads the graph in a stream.

Parameters:

stream (Stream) – The stream in which to upload the graph

Attributes