Skip to main content

cuGraphAddNode_v2

Function cuGraphAddNode_v2 

Source
pub unsafe extern "C" fn cuGraphAddNode_v2(
    phGraphNode: *mut CUgraphNode,
    hGraph: CUgraph,
    dependencies: *const CUgraphNode,
    dependencyData: *const CUgraphEdgeData,
    numDependencies: size_t,
    nodeParams: *mut CUgraphNodeParams,
) -> CUresult
Expand description

Adds a node of arbitrary type to a graph

Creates a new node in hGraph described by nodeParams with numDependencies dependencies specified via dependencies. numDependencies may be 0. dependencies may be null if numDependencies is 0. dependencies may not have any duplicate entries.

nodeParams is a tagged union. The node type should be specified in the type 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, nodeParams may contain “out parameters” which are modified during the call, such as nodeParams->alloc.dptr.

A handle to the new node will be returned in phGraphNode.

§Return value

::CUDA_SUCCESS, ::CUDA_ERROR_INVALID_VALUE, ::CUDA_ERROR_INVALID_CONTEXT, ::CUDA_ERROR_NOT_SUPPORTED

Note: _graph_thread_safety

See also: ::cuGraphCreate, ::cuGraphNodeSetParams, ::cuGraphExecNodeSetParams

§Parameters

  • phGraphNode: - Returns newly created node
  • hGraph: - Graph to which to add the node
  • dependencies: - Dependencies of the node
  • dependencyData: - Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies.
  • numDependencies: - Number of dependencies
  • nodeParams: - Specification of the node