Function rcudnn_sys::cudaGraphExecUpdate[][src]

pub unsafe extern "C" fn cudaGraphExecUpdate(
    hGraphExec: cudaGraphExec_t,
    hGraph: cudaGraph_t,
    hErrorNode_out: *mut cudaGraphNode_t,
    updateResult_out: *mut cudaGraphExecUpdateResult
) -> cudaError_t
Expand description

\brief Check whether an executable graph can be updated with a graph and perform the update if possible

Updates the node parameters in the instantiated graph specified by \p hGraphExec with the node parameters in a topologically identical graph specified by \p hGraph.

Limitations:

  • Kernel nodes:
    • The owning context of the function cannot change.
    • A node whose function originally did not use CUDA dynamic parallelism cannot be updated to a function which uses CDP
  • Memset and memcpy nodes:
    • The CUDA device(s) to which the operand(s) was allocated/mapped cannot change.
    • The source/destination memory must be allocated from the same contexts as the original source/destination memory.
    • Only 1D memsets can be changed.
  • Additional memcpy node restrictions:
    • Changing either the source or destination memory type(i.e. CU_MEMORYTYPE_DEVICE, CU_MEMORYTYPE_ARRAY, etc.) is not supported.

Note: The API may add further restrictions in future releases. The return code should always be checked.

cudaGraphExecUpdate sets \p updateResult_out to cudaGraphExecUpdateErrorTopologyChanged under the following conditions:

  • The count of nodes directly in \p hGraphExec and \p hGraph differ, in which case \p hErrorNode_out is NULL.
  • A node is deleted in \p hGraph but not not its pair from \p hGraphExec, in which case \p hErrorNode_out is NULL.
  • A node is deleted in \p hGraphExec but not its pair from \p hGraph, in which case \p hErrorNode_out is the pairless node from \p hGraph.
  • The dependent nodes of a pair differ, in which case \p hErrorNode_out is the node from \p hGraph.

cudaGraphExecUpdate sets \p updateResult_out to:

  • cudaGraphExecUpdateError if passed an invalid value.
  • cudaGraphExecUpdateErrorTopologyChanged if the graph topology changed
  • cudaGraphExecUpdateErrorNodeTypeChanged if the type of a node changed, in which case \p hErrorNode_out is set to the node from \p hGraph.
  • cudaGraphExecUpdateErrorFunctionChanged if the function of a kernel node changed (CUDA driver < 11.2)
  • cudaGraphExecUpdateErrorUnsupportedFunctionChange if the func field of a kernel changed in an unsupported way(see note above), in which case \p hErrorNode_out is set to the node from \p hGraph
  • cudaGraphExecUpdateErrorParametersChanged if any parameters to a node changed in a way that is not supported, in which case \p hErrorNode_out is set to the node from \p hGraph
  • cudaGraphExecUpdateErrorNotSupported if something about a node is unsupported, like the node’s type or configuration, in which case \p hErrorNode_out is set to the node from \p hGraph

If \p updateResult_out isn’t set in one of the situations described above, the update check passes and cudaGraphExecUpdate updates \p hGraphExec to match the contents of \p hGraph. If an error happens during the update, \p updateResult_out will be set to cudaGraphExecUpdateError; otherwise, \p updateResult_out is set to cudaGraphExecUpdateSuccess.

cudaGraphExecUpdate returns cudaSuccess when the updated was performed successfully. It returns cudaErrorGraphExecUpdateFailure if the graph update was not performed because it included changes which violated constraints specific to instantiated graph update.

\param hGraphExec The instantiated graph to be updated \param hGraph The graph containing the updated parameters \param hErrorNode_out The node which caused the permissibility check to forbid the update, if any \param updateResult_out Whether the graph update was permitted. If was forbidden, the reason why

\return ::cudaSuccess, ::cudaErrorGraphExecUpdateFailure, \note_graph_thread_safety \notefnerr \note_init_rt \note_callback

\sa ::cudaGraphInstantiate,