Skip to main content

cudaGraphClone

Function cudaGraphClone 

Source
pub unsafe extern "C" fn cudaGraphClone(
    pGraphClone: *mut cudaGraph_t,
    originalGraph: cudaGraph_t,
) -> cudaError_t
Expand description

Clones a graph.

This function creates a copy of originalGraph and returns it in pGraphClone. All parameters are copied into the cloned graph. The original graph may be modified after this call without affecting the clone.

Child graph nodes in the original graph are recursively copied into the clone.

Note: Cloning is not supported for graphs which contain memory allocation nodes, memory free nodes, or conditional nodes.

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

  • pGraphClone: Returns newly created cloned graph.
  • originalGraph: Graph to clone.

§Return value

See also: cudaGraphCreate, cudaGraphNodeFindInClone.