Skip to main content

cudaGraphAddDependencies

Function cudaGraphAddDependencies 

Source
pub unsafe extern "C" fn cudaGraphAddDependencies(
    graph: cudaGraph_t,
    from: *const cudaGraphNode_t,
    to: *const cudaGraphNode_t,
    edgeData: *const cudaGraphEdgeData,
    numDependencies: size_t,
) -> cudaError_t
Expand description

Adds dependency edges to a graph.

The number of dependencies to be added is defined by numDependencies Elements in pFrom and pTo at corresponding indices define a dependency. Each node in pFrom and pTo must belong to graph.

If numDependencies is 0, elements in pFrom and pTo will be ignored. Specifying an existing dependency will return an error.

Note: Graph objects are not threadsafe. More here.

Note that this function may also return error codes from previous, asynchronous launches.

Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.

Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.

§Parameters

  • graph: Graph to which dependencies are added.
  • from: Array of nodes that provide the dependencies.
  • to: Array of dependent nodes.
  • edgeData: Optional array of edge data. If NULL, default (zeroed) edge data is assumed.
  • numDependencies: Number of dependencies to be added.

§Return value

See also: cudaGraphRemoveDependencies, cudaGraphGetEdges, cudaGraphNodeGetDependencies, cudaGraphNodeGetDependentNodes.