pub unsafe extern "C" fn cuGraphAddNode_v3(
phGraphNode: *mut CUgraphNode,
hGraph: CUgraph,
dependencies: *const CUgraphNode,
dependencyData: *const CUgraphEdgeData,
numDependencies: size_t,
nodeParams: *mut CUgraphNodeParams,
) -> CUresultExpand 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.
For kernel nodes, if both the kernel node’s CUfunction and ctx are non-NULL, the underlying device context of ctx must match the device context that the CUfunction was loaded into; otherwise the call returns cudaError_enum::CUDA_ERROR_INVALID_CONTEXT.
A handle to the new node will be returned in phGraphNode.
Note: Graph objects are not threadsafe. More here.
Note that this function may also return error codes from previous, asynchronous launches.
§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.
§Return value
CUresult::CUDA_SUCCESSCUresult::CUDA_ERROR_INVALID_VALUECUresult::CUDA_ERROR_INVALID_CONTEXTCUresult::CUDA_ERROR_NOT_SUPPORTED
See also: cuGraphCreate, cuGraphNodeSetParams_v2, cuGraphExecNodeSetParams.