cuda.bindings._v2.driver.graph_add_node_v2#

cuda.bindings._v2.driver.graph_add_node_v2(
intptr_t h_graph,
dependencies,
dependency_data,
size_t num_dependencies,
node_params,
) → intptr_t#

Adds a node of arbitrary type to a graph.

Creates a new node in h_graph described by node_params with num_dependencies dependencies specified via dependencies. num_dependencies may be 0. dependencies may be null if num_dependencies is 0. dependencies may not have any duplicate entries. node_params is a tagged union. The node type should be specified in the typename field, and type-specific parameters in the corresponding union member. All unused bytes - that is, reserved0 and all bytes past the utilized union member - must be set to zero. It is recommended to use brace initialization or memset to ensure all bytes are initialized. Note that for some node types, node_params may contain “out parameters” which are modified during the call, such as node_params->alloc.dptr. A handle to the new node will be returned in ph_graph_node.

Parameters:
  • h_graph (intptr_t) – Graph to which to add the node.

  • dependencies (object) –

    Dependencies of the node. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of ints (as pointer addresses).

  • dependency_data (intptr_t) – Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies.

  • num_dependencies (size_t) – Number of dependencies.

  • node_params (intptr_t) – Specification of the node.

Returns:

Returns newly created node.

Return type:

intptr_t

See also

cuGraphAddNode_v2