cuda.bindings._v2.driver.graph_add_node_v3#
- cuda.bindings._v2.driver.graph_add_node_v3(
- intptr_t h_graph,
- dependencies,
- dependency_data,
- size_t num_dependencies,
- node_params,
Adds a node of arbitrary type to a graph.
Creates a new node in
h_graphdescribed bynode_paramswithnum_dependenciesdependencies specified viadependencies.num_dependenciesmay be 0.dependenciesmay be null ifnum_dependenciesis 0.dependenciesmay not have any duplicate entries.node_paramsis a tagged union. The node type should be specified in thetypenamefield, and type-specific parameters in the corresponding union member. All unused bytes - that is,reserved0and 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_paramsmay contain “out parameters” which are modified during the call, such asnode_params->alloc.dptr. For kernel nodes, if both the kernel node’sCUfunctionand ctx are non- NULL, the underlying device context of ctx must match the device context that theCUfunctionwas loaded into; otherwise the call returnsCUDA_ERROR_INVALID_CONTEXT. A handle to the new node will be returned inph_graph_node.- Parameters:
h_graph (intptr_t) – Graph to which to add the node.
dependencies (object) –
Dependencies of the node. It can be:
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_v3