Class CudaGraph
Managed wrapper around a captured CUDA graph. 已捕获 CUDA graph 的托管封装。
public sealed class CudaGraph : IDisposable
- Inheritance
-
CudaGraph
- Implements
- Inherited Members
Properties
EdgeCount
Gets the number of dependency edges currently in this graph. 获取当前 graph 中的依赖 edge 数量。
public ulong EdgeCount { get; }
Property Value
Id
Gets the CUDA graph identifier when supported by the loaded CUDA runtime. 在当前 CUDA runtime 支持时获取 CUDA graph 标识符。
public uint Id { get; }
Property Value
NodeCount
Gets the number of nodes currently in this graph. 获取当前 graph 中的 node 数量。
public ulong NodeCount { get; }
Property Value
RootNodeCount
Gets the number of root nodes currently in this graph. 获取当前 graph 中的 root node 数量。
public ulong RootNodeCount { get; }
Property Value
Methods
AddChildGraphNode(CudaGraph)
Adds a child-graph node containing a clone of another managed CUDA graph. 添加一个包含另一托管 CUDA graph 克隆的 child-graph 节点。
public CudaGraphNode AddChildGraphNode(CudaGraph childGraph)
Parameters
childGraphCudaGraphThe graph copied into the new node. 复制到新节点中的 graph。
Returns
- CudaGraphNode
A graph-owned child node token. 由当前 graph 拥有的 child node token。
AddChildGraphNodeAfter(CudaGraphNode, CudaGraph)
Adds a child-graph node after an existing dependency node. 在现有依赖节点之后添加 child-graph 节点。
public CudaGraphNode AddChildGraphNodeAfter(CudaGraphNode dependencyNode, CudaGraph childGraph)
Parameters
dependencyNodeCudaGraphNodeThe dependency node. 依赖节点。
childGraphCudaGraphThe graph copied into the new node. 复制到新节点中的 graph。
Returns
- CudaGraphNode
A graph-owned child node token. 由当前 graph 拥有的 child node token。
AddConditionalNode(CudaGraphConditionalHandle, CudaGraphConditionalNodeType, uint)
Adds a CUDA conditional node with no parent dependency. 添加一个没有 parent dependency 的 CUDA conditional node。
public CudaGraphConditionalNode AddConditionalNode(CudaGraphConditionalHandle handle, CudaGraphConditionalNodeType nodeType, uint bodyCount)
Parameters
handleCudaGraphConditionalHandlenodeTypeCudaGraphConditionalNodeTypebodyCountuint
Returns
AddConditionalNodeAfter(CudaGraphConditionalHandle, CudaGraphConditionalNodeType, uint, CudaGraphNode)
Adds a CUDA conditional node after a parent graph dependency. 在 parent graph dependency 之后添加 CUDA conditional node。
public CudaGraphConditionalNode AddConditionalNodeAfter(CudaGraphConditionalHandle handle, CudaGraphConditionalNodeType nodeType, uint bodyCount, CudaGraphNode dependencyNode)
Parameters
handleCudaGraphConditionalHandlenodeTypeCudaGraphConditionalNodeTypebodyCountuintdependencyNodeCudaGraphNode
Returns
AddDependency(CudaGraphNode, CudaGraphNode)
Adds a dependency edge between two nodes in this graph. 在当前 graph 的两个节点之间添加依赖边。
public void AddDependency(CudaGraphNode fromNode, CudaGraphNode toNode)
Parameters
fromNodeCudaGraphNodeThe source node. 源节点。
toNodeCudaGraphNodeThe destination node. 目标节点。
AddDependency(CudaGraphNode, CudaGraphNode, CudaGraphEdgeData)
Adds a dependency edge with explicit CUDA edge data. 使用显式 CUDA edge data 添加两个节点之间的依赖边。
public void AddDependency(CudaGraphNode fromNode, CudaGraphNode toNode, CudaGraphEdgeData edgeData)
Parameters
fromNodeCudaGraphNodeThe source node. 源节点。
toNodeCudaGraphNodeThe destination node. 目标节点。
edgeDataCudaGraphEdgeDataThe CUDA graph edge data. CUDA graph 边数据。
Remarks
This API uses graph-owned node tokens and copied edge-data values; no native pointer is exposed or retained by public C#. 该 API 使用 graph-owned node token 和已复制的 edge-data 值;public C# 不暴露或保留原生指针。
AddDeviceToDeviceMemcpyNode(CudaMemory, CudaMemory, int)
Adds a 1D device-to-device memcpy node to this graph. 向当前 graph 添加 1D device-to-device memcpy 节点。
public CudaGraphNode AddDeviceToDeviceMemcpyNode(CudaMemory destination, CudaMemory source, int count)
Parameters
destinationCudaMemoryThe destination device memory owner. 目标设备内存所有者。
sourceCudaMemoryThe source device memory owner. 源设备内存所有者。
countintThe byte count to copy. 要复制的字节数。
Returns
- CudaGraphNode
A graph-owned memcpy node token. 由 graph 拥有的 memcpy node token。
Remarks
The memory owners must remain alive while the graph or any executable graph created from it may use this node. 内存所有者必须在 graph 或由该 graph 创建的 executable graph 可能使用该节点期间保持存活。
AddDeviceToDeviceMemcpyNodeAfter(CudaGraphNode, CudaMemory, CudaMemory, int)
Adds a dependent 1D device-to-device memcpy node to this graph. 向当前 graph 添加带依赖的 1D device-to-device memcpy 节点。
public CudaGraphNode AddDeviceToDeviceMemcpyNodeAfter(CudaGraphNode dependencyNode, CudaMemory destination, CudaMemory source, int count)
Parameters
dependencyNodeCudaGraphNodeThe dependency node, or the default token for no dependency. 依赖节点;默认 token 表示无依赖。
destinationCudaMemoryThe destination device memory owner. 目标设备内存所有者。
sourceCudaMemoryThe source device memory owner. 源设备内存所有者。
countintThe byte count to copy. 要复制的字节数。
Returns
- CudaGraphNode
A graph-owned memcpy node token. 由 graph 拥有的 memcpy node token。
AddDeviceToHostMemcpyNode(CudaPinnedMemory, CudaGraphMemoryAllocation, int)
Adds a graph-allocation-to-pinned-host copy node for runtime verification or output transfer. 添加 graph allocation 到 pinned host 的复制节点,用于运行验证或输出传输。
public CudaGraphNode AddDeviceToHostMemcpyNode(CudaPinnedMemory destination, CudaGraphMemoryAllocation source, int count)
Parameters
destinationCudaPinnedMemorysourceCudaGraphMemoryAllocationcountint
Returns
AddDeviceToHostMemcpyNode(CudaPinnedMemory, CudaMemory, int)
Adds a 1D device-to-pinned-host memcpy node to this graph. 向当前 graph 添加 1D device-to-pinned-host memcpy 节点。
public CudaGraphNode AddDeviceToHostMemcpyNode(CudaPinnedMemory destination, CudaMemory source, int count)
Parameters
destinationCudaPinnedMemoryThe destination pinned host memory owner. 目标 pinned host memory 所有者。
sourceCudaMemoryThe source device memory owner. 源设备内存所有者。
countintThe byte count to copy. 要复制的字节数。
Returns
- CudaGraphNode
A graph-owned memcpy node token. 由 graph 拥有的 memcpy node token。
Remarks
The memory owners must remain alive while the graph or any executable graph created from it may use this node. 内存所有者必须在 graph 或由该 graph 创建的 executable graph 可能使用该节点期间保持存活。
AddDeviceToHostMemcpyNodeAfter(CudaGraphNode, CudaPinnedMemory, CudaGraphMemoryAllocation, int)
Adds a dependent graph-allocation-to-host copy node. 添加带依赖的 graph allocation 到 host 复制节点。
public CudaGraphNode AddDeviceToHostMemcpyNodeAfter(CudaGraphNode dependencyNode, CudaPinnedMemory destination, CudaGraphMemoryAllocation source, int count)
Parameters
dependencyNodeCudaGraphNodedestinationCudaPinnedMemorysourceCudaGraphMemoryAllocationcountint
Returns
AddDeviceToHostMemcpyNodeAfter(CudaGraphNode, CudaPinnedMemory, CudaMemory, int)
Adds a dependent 1D device-to-pinned-host memcpy node to this graph. 向当前 graph 添加带依赖的 1D device-to-pinned-host memcpy 节点。
public CudaGraphNode AddDeviceToHostMemcpyNodeAfter(CudaGraphNode dependencyNode, CudaPinnedMemory destination, CudaMemory source, int count)
Parameters
dependencyNodeCudaGraphNodeThe dependency node, or the default token for no dependency. 依赖节点;默认 token 表示无依赖。
destinationCudaPinnedMemoryThe destination pinned host memory owner. 目标 pinned host memory 所有者。
sourceCudaMemoryThe source device memory owner. 源设备内存所有者。
countintThe byte count to copy. 要复制的字节数。
Returns
- CudaGraphNode
A graph-owned memcpy node token. 由 graph 拥有的 memcpy node token。
AddEmptyNode()
Adds an empty node to this graph. 向当前 graph 添加一个空节点。
public CudaGraphNode AddEmptyNode()
Returns
- CudaGraphNode
A graph-owned node token. 由 graph 拥有的 node token。
AddEmptyNodeAfter(CudaGraphNode)
Adds an empty node that depends on an existing node. 添加一个依赖现有节点的空节点。
public CudaGraphNode AddEmptyNodeAfter(CudaGraphNode dependencyNode)
Parameters
dependencyNodeCudaGraphNodeThe dependency node. 依赖节点。
Returns
- CudaGraphNode
A graph-owned node token. 由 graph 拥有的 node token。
AddEventRecordNode(CudaEvent)
Adds an event-record node to this graph. 向当前 graph 添加 event-record 节点。
public CudaGraphNode AddEventRecordNode(CudaEvent eventHandle)
Parameters
eventHandleCudaEventThe caller-owned CUDA event used by the graph node. graph 节点使用的调用方拥有的 CUDA event。
Returns
- CudaGraphNode
A graph-owned event-record node token. 由 graph 拥有的 event-record node token。
Remarks
The event must remain alive while the graph or any executable graph created from it may use this node. 该 event 必须在 graph 或由该 graph 创建的 executable graph 可能使用该节点期间保持存活。
AddEventRecordNodeAfter(CudaGraphNode, CudaEvent)
Adds an event-record node that depends on an existing graph node. 添加一个依赖现有节点的 event-record 节点。
public CudaGraphNode AddEventRecordNodeAfter(CudaGraphNode dependencyNode, CudaEvent eventHandle)
Parameters
dependencyNodeCudaGraphNodeThe dependency node. 依赖节点。
eventHandleCudaEventThe caller-owned CUDA event used by the graph node. graph 节点使用的调用方拥有的 CUDA event。
Returns
- CudaGraphNode
A graph-owned event-record node token. 由 graph 拥有的 event-record node token。
Remarks
The event must remain alive while the graph or any executable graph created from it may use this node. 该 event 必须在 graph 或由该 graph 创建的 executable graph 可能使用该节点期间保持存活。
AddEventWaitNode(CudaEvent)
Adds an event-wait node to this graph. 向当前 graph 添加 event-wait 节点。
public CudaGraphNode AddEventWaitNode(CudaEvent eventHandle)
Parameters
eventHandleCudaEventThe caller-owned CUDA event waited on by the graph node. graph 节点等待的调用方拥有的 CUDA event。
Returns
- CudaGraphNode
A graph-owned event-wait node token. 由 graph 拥有的 event-wait node token。
Remarks
The event must remain alive while the graph or any executable graph created from it may use this node. 该 event 必须在 graph 或由该 graph 创建的 executable graph 可能使用该节点期间保持存活。
AddEventWaitNodeAfter(CudaGraphNode, CudaEvent)
Adds an event-wait node that depends on an existing graph node. 添加一个依赖现有节点的 event-wait 节点。
public CudaGraphNode AddEventWaitNodeAfter(CudaGraphNode dependencyNode, CudaEvent eventHandle)
Parameters
dependencyNodeCudaGraphNodeThe dependency node. 依赖节点。
eventHandleCudaEventThe caller-owned CUDA event waited on by the graph node. graph 节点等待的调用方拥有的 CUDA event。
Returns
- CudaGraphNode
A graph-owned event-wait node token. 由 graph 拥有的 event-wait node token。
Remarks
The event must remain alive while the graph or any executable graph created from it may use this node. 该 event 必须在 graph 或由该 graph 创建的 executable graph 可能使用该节点期间保持存活。
AddHostToDeviceMemcpyNode(CudaMemory, CudaPinnedMemory, int)
Adds a 1D pinned-host-to-device memcpy node to this graph. 向当前 graph 添加 1D pinned-host-to-device memcpy 节点。
public CudaGraphNode AddHostToDeviceMemcpyNode(CudaMemory destination, CudaPinnedMemory source, int count)
Parameters
destinationCudaMemoryThe destination device memory owner. 目标设备内存所有者。
sourceCudaPinnedMemoryThe source pinned host memory owner. 源 pinned host memory 所有者。
countintThe byte count to copy. 要复制的字节数。
Returns
- CudaGraphNode
A graph-owned memcpy node token. 由 graph 拥有的 memcpy node token。
Remarks
The memory owners must remain alive while the graph or any executable graph created from it may use this node. 内存所有者必须在 graph 或由该 graph 创建的 executable graph 可能使用该节点期间保持存活。
AddHostToDeviceMemcpyNodeAfter(CudaGraphNode, CudaMemory, CudaPinnedMemory, int)
Adds a dependent 1D pinned-host-to-device memcpy node to this graph. 向当前 graph 添加带依赖的 1D pinned-host-to-device memcpy 节点。
public CudaGraphNode AddHostToDeviceMemcpyNodeAfter(CudaGraphNode dependencyNode, CudaMemory destination, CudaPinnedMemory source, int count)
Parameters
dependencyNodeCudaGraphNodeThe dependency node, or the default token for no dependency. 依赖节点;默认 token 表示无依赖。
destinationCudaMemoryThe destination device memory owner. 目标设备内存所有者。
sourceCudaPinnedMemoryThe source pinned host memory owner. 源 pinned host memory 所有者。
countintThe byte count to copy. 要复制的字节数。
Returns
- CudaGraphNode
A graph-owned memcpy node token. 由 graph 拥有的 memcpy node token。
AddMemoryAllocationNode(int, int)
Adds a pointer-free, graph-owned device-memory allocation node. 添加无指针、由 graph 拥有的 device-memory allocation node。
public CudaGraphMemoryAllocation AddMemoryAllocationNode(int sizeInBytes, int deviceOrdinal)
Parameters
Returns
AddMemoryAllocationNodeAfter(CudaGraphNode, int, int)
Adds a dependent pointer-free graph memory-allocation node. 添加带依赖的无指针 graph memory-allocation node。
public CudaGraphMemoryAllocation AddMemoryAllocationNodeAfter(CudaGraphNode dependencyNode, int sizeInBytes, int deviceOrdinal)
Parameters
dependencyNodeCudaGraphNodesizeInBytesintdeviceOrdinalint
Returns
AddMemoryFreeNode(CudaGraphMemoryAllocation, CudaGraphNode)
Adds the single matching memory-free node for a graph allocation. 为 graph allocation 添加唯一匹配的 memory-free node。
public CudaGraphNode AddMemoryFreeNode(CudaGraphMemoryAllocation allocation, CudaGraphNode dependencyNode = default)
Parameters
allocationCudaGraphMemoryAllocationdependencyNodeCudaGraphNode
Returns
AddMemsetNode(CudaGraphMemoryAllocation, byte, int)
Adds a memset node for a pointer-free graph allocation and depends on its allocation node. 为无指针 graph allocation 添加 memset node,并自动依赖其 allocation node。
public CudaGraphNode AddMemsetNode(CudaGraphMemoryAllocation destination, byte value, int count)
Parameters
destinationCudaGraphMemoryAllocationvaluebytecountint
Returns
AddMemsetNode(CudaMemory, byte, int)
Adds a one-dimensional byte memset node backed by a managed device-memory owner. 添加由托管设备内存 owner 支撑的一维 byte memset 节点。
public CudaGraphNode AddMemsetNode(CudaMemory destination, byte value, int count)
Parameters
destinationCudaMemoryvaluebytecountint
Returns
Remarks
The destination must remain alive while this graph or an executable graph may use the node. 当 graph 或 executable graph 可能使用该节点时,destination 必须保持存活。
AddMemsetNodeAfter(CudaGraphNode, CudaGraphMemoryAllocation, byte, int)
Adds a dependent memset node for a graph allocation. 为 graph allocation 添加带依赖的 memset node。
public CudaGraphNode AddMemsetNodeAfter(CudaGraphNode dependencyNode, CudaGraphMemoryAllocation destination, byte value, int count)
Parameters
dependencyNodeCudaGraphNodedestinationCudaGraphMemoryAllocationvaluebytecountint
Returns
AddMemsetNodeAfter(CudaGraphNode, CudaMemory, byte, int)
Adds a one-dimensional byte memset node after an existing dependency. 在现有 dependency 之后添加一维 byte memset 节点。
public CudaGraphNode AddMemsetNodeAfter(CudaGraphNode dependencyNode, CudaMemory destination, byte value, int count)
Parameters
dependencyNodeCudaGraphNodedestinationCudaMemoryvaluebytecountint
Returns
Remarks
The destination must remain alive while this graph or an executable graph may use the node. 当 graph 或 executable graph 可能使用该节点时,destination 必须保持存活。
Clone()
Clones this CUDA graph into a new managed graph wrapper. 将当前 CUDA graph 克隆为新的托管 graph 封装。
public CudaGraph Clone()
Returns
- CudaGraph
A cloned CUDA graph. 克隆后的 CUDA graph。
ContainsNode(CudaGraphNode)
Returns whether CUDA reports that a node belongs to this graph. 返回 CUDA 是否报告指定 node 属于当前 graph。
public bool ContainsNode(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe graph node token. graph node 的 token。
Returns
- bool
true when the node's containing graph is this graph. 当 node 的 containing graph 是当前 graph 时返回 true。
CopyKernelNodeAttributes(CudaGraphNode, CudaGraphNode)
Copies CUDA kernel-node attributes from one graph-owned node to another. 将 CUDA kernel node attribute 从一个 graph-owned 节点复制到另一个节点。
public static void CopyKernelNodeAttributes(CudaGraphNode destinationNode, CudaGraphNode sourceNode)
Parameters
destinationNodeCudaGraphNodeThe destination kernel node. 目标 kernel 节点。
sourceNodeCudaGraphNodeThe source kernel node. 源 kernel 节点。
Create(uint)
Creates an empty CUDA graph. 创建一个空 CUDA graph。
public static CudaGraph Create(uint flags = 0)
Parameters
flagsuintCUDA graph creation flags. CUDA graph 创建标志。
Returns
- CudaGraph
A managed CUDA graph wrapper. 托管 CUDA graph 封装。
CreateConditionalHandle(uint, CudaGraphConditionalHandleFlags)
Creates a CUDA conditional handle associated with this graph. 创建一个与当前 graph 关联的 CUDA conditional handle。
public CudaGraphConditionalHandle CreateConditionalHandle(uint defaultLaunchValue = 0, CudaGraphConditionalHandleFlags flags = CudaGraphConditionalHandleFlags.None)
Parameters
defaultLaunchValueuintflagsCudaGraphConditionalHandleFlags
Returns
CreateConditionalHandleV2(CudaPrimaryExecutionContext?, uint, CudaGraphConditionalHandleFlags)
Creates a CUDA 13 conditional handle, optionally bound to a primary execution context. 创建 CUDA 13 conditional handle,可选绑定到主 execution context。
public CudaGraphConditionalHandle CreateConditionalHandleV2(CudaPrimaryExecutionContext? context = null, uint defaultLaunchValue = 0, CudaGraphConditionalHandleFlags flags = CudaGraphConditionalHandleFlags.None)
Parameters
contextCudaPrimaryExecutionContextdefaultLaunchValueuintflagsCudaGraphConditionalHandleFlags
Returns
Dispose()
Releases the captured CUDA graph handle. 释放已捕获的 CUDA graph 句柄。
public void Dispose()
EventRecordNodeHasEvent(CudaGraphNode)
Gets whether an event-record node currently references a CUDA event without exposing the borrowed event handle. 查询 event-record 节点当前是否引用 CUDA event,但不暴露 borrowed event handle。
public static bool EventRecordNodeHasEvent(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe graph-owned event-record node token. Graph 拥有的 event-record node token。
Returns
Remarks
This is a copied scalar snapshot over cudaGraphEventRecordNodeGetEvent; it intentionally does not return CudaEvent or a native pointer.
这是基于 cudaGraphEventRecordNodeGetEvent 的复制型标量快照;有意不返回 CudaEvent 或原生指针。
EventWaitNodeHasEvent(CudaGraphNode)
Gets whether an event-wait node currently references a CUDA event without exposing the borrowed event handle. 查询 event-wait 节点当前是否引用 CUDA event,但不暴露 borrowed event handle。
public static bool EventWaitNodeHasEvent(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe graph-owned event-wait node token. Graph 拥有的 event-wait node token。
Returns
Remarks
This is a copied scalar snapshot over cudaGraphEventWaitNodeGetEvent; it intentionally does not return CudaEvent or a native pointer.
这是基于 cudaGraphEventWaitNodeGetEvent 的复制型标量快照;有意不返回 CudaEvent 或原生指针。
ExportDebugDot(string, CudaGraphDebugDotFlags)
Exports this CUDA graph to a Graphviz DOT file for diagnostics. 将当前 CUDA graph 导出为 Graphviz DOT 诊断文件。
public void ExportDebugDot(string path, CudaGraphDebugDotFlags flags = CudaGraphDebugDotFlags.None)
Parameters
pathstringThe output file path. 输出文件路径。
flagsCudaGraphDebugDotFlagsCUDA graph debug DOT flags. CUDA graph debug DOT 标志。
FindNodeInClone(CudaGraphNode)
Finds the clone-owned node that corresponds to an original graph node. 查找 cloned graph 中对应原始 graph 节点的 node token。
public CudaGraphNode FindNodeInClone(CudaGraphNode originalNode)
Parameters
originalNodeCudaGraphNodeThe node from the original graph. 原始 graph 中的节点。
Returns
- CudaGraphNode
The node token owned by this cloned graph. 由当前 cloned graph 拥有的 node token。
GetChildGraphSnapshot(CudaGraphNode)
Gets copied topology metadata for the embedded graph of a child-graph node. 获取 child-graph 节点中 embedded graph 的复制型拓扑元数据。
public CudaGraphChildSnapshot GetChildGraphSnapshot(CudaGraphNode node)
Parameters
nodeCudaGraphNodeA child-graph node token. Child-graph 节点 token。
Returns
- CudaGraphChildSnapshot
A scalar-only embedded graph snapshot. 仅包含标量的 embedded graph 快照。
GetDependency(CudaGraphNode, ulong)
Gets a dependency node by index for a graph node. 按索引获取指定 graph node 的依赖节点。
public static CudaGraphNode GetDependency(CudaGraphNode node, ulong index)
Parameters
nodeCudaGraphNodeThe node token. 节点 token。
indexulongThe zero-based dependency index. 从零开始的依赖索引。
Returns
- CudaGraphNode
The dependency node token. 依赖节点 token。
GetDependencyCount(CudaGraphNode)
Gets the number of dependencies for a graph node. 获取指定 graph node 的依赖数量。
public static ulong GetDependencyCount(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe node token. 节点 token。
Returns
- ulong
The dependency count. 依赖数量。
GetDependencyWithEdgeData(CudaGraphNode, ulong)
Gets a dependency node and CUDA edge data by index for a graph node. 按索引获取指定 graph node 的依赖节点和 CUDA edge data。
public static CudaGraphNodeDependency GetDependencyWithEdgeData(CudaGraphNode node, ulong index)
Parameters
nodeCudaGraphNodeThe node token. 节点 token。
indexulongThe zero-based dependency index. 从零开始的依赖索引。
Returns
- CudaGraphNodeDependency
The dependency node and edge data. 依赖节点和 edge data。
GetDependencyWithEdgeDataCount(CudaGraphNode)
Gets the number of dependencies with CUDA edge data for a graph node. 获取指定 graph node 带 CUDA edge data 的依赖数量。
public static ulong GetDependencyWithEdgeDataCount(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe node token. 节点 token。
Returns
- ulong
The dependency count. 依赖数量。
GetDependent(CudaGraphNode, ulong)
Gets a dependent node by index for a graph node. 按索引获取依赖指定 graph node 的节点。
public static CudaGraphNode GetDependent(CudaGraphNode node, ulong index)
Parameters
nodeCudaGraphNodeThe node token. 节点 token。
indexulongThe zero-based dependent index. 从零开始的 dependent 节点索引。
Returns
- CudaGraphNode
The dependent node token. dependent 节点 token。
GetDependentCount(CudaGraphNode)
Gets the number of dependent nodes for a graph node. 获取依赖指定 graph node 的节点数量。
public static ulong GetDependentCount(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe node token. 节点 token。
Returns
- ulong
The dependent count. dependent 节点数量。
GetDependentWithEdgeData(CudaGraphNode, ulong)
Gets a dependent node and CUDA edge data by index for a graph node. 按索引获取依赖指定 graph node 的节点和 CUDA edge data。
public static CudaGraphNodeDependency GetDependentWithEdgeData(CudaGraphNode node, ulong index)
Parameters
nodeCudaGraphNodeThe node token. 节点 token。
indexulongThe zero-based dependent index. 从零开始的 dependent 节点索引。
Returns
- CudaGraphNodeDependency
The dependent node and edge data. dependent 节点和 edge data。
GetDependentWithEdgeDataCount(CudaGraphNode)
Gets the number of dependent nodes with CUDA edge data for a graph node. 获取依赖指定 graph node 且带 CUDA edge data 的节点数量。
public static ulong GetDependentWithEdgeDataCount(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe node token. 节点 token。
Returns
- ulong
The dependent node count. dependent 节点数量。
GetDiagnosticSnapshot(ulong, ulong, ulong)
Gets a bounded copied diagnostic snapshot for this graph. 获取当前 graph 的有界复制型诊断快照。
public CudaGraphDiagnosticSnapshot GetDiagnosticSnapshot(ulong maxNodes = 64, ulong maxRootNodes = 64, ulong maxEdges = 64)
Parameters
maxNodesulongThe maximum number of graph nodes to copy. 要复制的最大 graph node 数量。
maxRootNodesulongThe maximum number of root nodes to copy. 要复制的最大 root node 数量。
maxEdgesulongThe maximum number of dependency edges to copy. 要复制的最大依赖边数量。
Returns
- CudaGraphDiagnosticSnapshot
A bounded copied graph diagnostic snapshot. 有界复制型 graph 诊断快照。
GetEdge(ulong)
Gets a dependency edge by index from this graph. 按索引获取当前 graph 中的依赖边。
public CudaGraphEdge GetEdge(ulong index)
Parameters
indexulongThe zero-based edge index. 从零开始的边索引。
Returns
- CudaGraphEdge
The graph edge. Graph 依赖边。
GetEdgeSnapshotList(bool, ulong)
Gets copied snapshots for graph dependency edges. 获取 graph 依赖边的复制型快照列表。
public IReadOnlyList<CudaGraphEdgeSnapshot> GetEdgeSnapshotList(bool includeEdgeData = true, ulong maxEdges = 18446744073709551615)
Parameters
includeEdgeDataboolWhether to prefer CUDA edge-data queries. 是否优先使用 CUDA edge-data 查询。
maxEdgesulongThe maximum number of edges to copy. 要复制的最大边数量。
Returns
- IReadOnlyList<CudaGraphEdgeSnapshot>
Bounded edge snapshots. 有界 edge 快照列表。
GetEdgeWithEdgeData(ulong)
Gets a dependency edge and CUDA edge data by index from this graph. 按索引获取当前 graph 中的依赖边和 CUDA edge data。
public CudaGraphEdgeWithData GetEdgeWithEdgeData(ulong index)
Parameters
indexulongThe zero-based edge index. 从零开始的边索引。
Returns
- CudaGraphEdgeWithData
The graph edge and edge data. Graph 依赖边和 edge data。
GetEdgeWithEdgeDataCount()
Gets the number of dependency edges available through the CUDA edge-data query. 获取可通过 CUDA edge-data 查询访问的依赖边数量。
public ulong GetEdgeWithEdgeDataCount()
Returns
GetExternalSemaphoreSignalNodeSnapshot(CudaGraphNode)
Gets copied count metadata for an external-semaphore signal node. 获取 external-semaphore signal 节点的复制型 count 元数据。
public static CudaGraphExternalSemaphoreNodeSnapshot GetExternalSemaphoreSignalNodeSnapshot(CudaGraphNode node)
Parameters
nodeCudaGraphNode
Returns
GetExternalSemaphoreWaitNodeSnapshot(CudaGraphNode)
Gets copied count metadata for an external-semaphore wait node. 获取 external-semaphore wait 节点的复制型 count 元数据。
public static CudaGraphExternalSemaphoreNodeSnapshot GetExternalSemaphoreWaitNodeSnapshot(CudaGraphNode node)
Parameters
nodeCudaGraphNode
Returns
GetHostNodeParametersSnapshot(CudaGraphNode)
Gets callback-presence metadata for a host node without exposing callback pointers. 获取 host 节点的 callback 存在性元数据,不暴露 callback pointer。
public static CudaGraphHostNodeParametersSnapshot GetHostNodeParametersSnapshot(CudaGraphNode node)
Parameters
nodeCudaGraphNode
Returns
GetKernelNodeAttribute(CudaGraphNode, CudaGraphKernelNodeAttribute)
Gets a copied scalar attribute descriptor from a CUDA graph kernel node. 从 CUDA graph kernel 节点获取复制出的标量 attribute descriptor。
public static CudaGraphKernelNodeAttributeValue GetKernelNodeAttribute(CudaGraphNode node, CudaGraphKernelNodeAttribute attribute)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
attributeCudaGraphKernelNodeAttributeThe supported scalar attribute. 支持的标量 attribute。
Returns
- CudaGraphKernelNodeAttributeValue
The copied attribute descriptor. 复制出的 attribute descriptor。
Remarks
This method supports only scalar or scalar-vector attributes with stable ABI: cooperative, priority, cluster dimension, and cluster scheduling policy preference. 该方法只支持 ABI 稳定的标量或标量向量 attribute:cooperative、priority、cluster dimension 和 cluster scheduling policy preference。
GetKernelNodeClusterDimension(CudaGraphNode)
Gets a CUDA graph kernel node cluster dimension descriptor. 获取 CUDA graph kernel 节点 cluster dimension descriptor。
public static CudaGraphKernelNodeAttributeValue GetKernelNodeClusterDimension(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
Returns
GetKernelNodeClusterSchedulingPolicy(CudaGraphNode)
Gets a CUDA graph kernel node cluster scheduling policy preference. 获取 CUDA graph kernel 节点 cluster scheduling policy preference。
public static CudaClusterSchedulingPolicyPreference GetKernelNodeClusterSchedulingPolicy(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
Returns
GetKernelNodeCooperative(CudaGraphNode)
Gets whether a CUDA graph kernel node is marked cooperative. 获取 CUDA graph kernel 节点是否标记为 cooperative。
public static bool GetKernelNodeCooperative(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
Returns
GetKernelNodeParametersSnapshot(CudaGraphNode)
Gets copied scalar parameters for a kernel node without exposing function or argument pointers. 获取 kernel 节点的复制型标量参数,不暴露 function 或 argument pointer。
public static CudaGraphKernelNodeParametersSnapshot GetKernelNodeParametersSnapshot(CudaGraphNode node)
Parameters
nodeCudaGraphNode
Returns
GetKernelNodePriority(CudaGraphNode)
Gets a CUDA graph kernel node priority. 获取 CUDA graph kernel 节点 priority。
public static int GetKernelNodePriority(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
Returns
GetMemcpyNodeParameters(CudaGraphNode)
Gets copied diagnostic parameters from a CUDA graph memcpy node. 从 CUDA graph memcpy 节点获取复制出的诊断参数。
public static CudaGraphMemcpyNodeParameters GetMemcpyNodeParameters(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe memcpy node token. memcpy 节点 token。
Returns
- CudaGraphMemcpyNodeParameters
Copied memcpy node parameters. 复制出的 memcpy node 参数。
Remarks
Returned addresses are diagnostic numeric values only and do not transfer memory ownership. 返回的地址仅为诊断数值,不转移内存所有权。
GetMemoryAllocationNodeSnapshot(CudaGraphNode)
Gets copied scalar metadata for a graph memory-allocation node. 获取 graph memory-allocation 节点的复制型标量元数据。
public static CudaGraphMemoryAllocationNodeSnapshot GetMemoryAllocationNodeSnapshot(CudaGraphNode node)
Parameters
nodeCudaGraphNode
Returns
GetMemoryFreeNodeSnapshot(CudaGraphNode)
Gets pointer-presence metadata for a graph memory-free node. 获取 graph memory-free 节点的 pointer 存在性元数据。
public static CudaGraphMemoryFreeNodeSnapshot GetMemoryFreeNodeSnapshot(CudaGraphNode node)
Parameters
nodeCudaGraphNode
Returns
GetMemsetNodeParameters(CudaGraphNode)
Gets copied scalar parameters from a CUDA graph memset node. 从 CUDA graph memset 节点获取复制出的标量参数。
public static CudaGraphMemsetNodeParameters GetMemsetNodeParameters(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe memset node token. memset 节点 token。
Returns
- CudaGraphMemsetNodeParameters
Copied memset node parameters. 复制出的 memset node 参数。
Remarks
The returned destination address is diagnostic only and does not transfer memory ownership. 返回的目标地址仅用于诊断,不转移内存所有权。
GetNode(ulong)
Gets a node token by index from this graph. 按索引获取当前 graph 中的节点 token。
public CudaGraphNode GetNode(ulong index)
Parameters
indexulongThe zero-based node index. 从零开始的节点索引。
Returns
- CudaGraphNode
A graph-owned node token. 由 graph 拥有的 node token。
GetNodeDependencySnapshotList(CudaGraphNode, bool, ulong)
Gets copied snapshots for node dependencies. 获取指定 node 依赖项的复制型快照列表。
public static IReadOnlyList<CudaGraphAdjacentNodeSnapshot> GetNodeDependencySnapshotList(CudaGraphNode node, bool includeEdgeData = true, ulong maxDependencies = 18446744073709551615)
Parameters
nodeCudaGraphNodeThe graph node token. 图节点令牌。
includeEdgeDataboolWhether to prefer CUDA edge-data queries. 是否优先使用 CUDA edge-data 查询。
maxDependenciesulongThe maximum number of dependencies to copy. 要复制的最大依赖数量。
Returns
- IReadOnlyList<CudaGraphAdjacentNodeSnapshot>
Bounded dependency snapshots. 有界依赖快照列表。
GetNodeDependentSnapshotList(CudaGraphNode, bool, ulong)
Gets copied snapshots for node dependents. 获取依赖指定 node 的节点复制型快照列表。
public static IReadOnlyList<CudaGraphAdjacentNodeSnapshot> GetNodeDependentSnapshotList(CudaGraphNode node, bool includeEdgeData = true, ulong maxDependents = 18446744073709551615)
Parameters
nodeCudaGraphNodeThe graph node token. 图节点令牌。
includeEdgeDataboolWhether to prefer CUDA edge-data queries. 是否优先使用 CUDA edge-data 查询。
maxDependentsulongThe maximum number of dependents to copy. 要复制的最大 dependent 数量。
Returns
- IReadOnlyList<CudaGraphAdjacentNodeSnapshot>
Bounded dependent snapshots. 有界 dependent 快照列表。
GetNodeLocalId(CudaGraphNode)
Gets the CUDA runtime local id for a graph node when supported by the loaded runtime. 在当前 CUDA runtime 支持时获取 graph node 的 local id。
public static uint GetNodeLocalId(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe graph node token. graph node 的 token。
Returns
- uint
The CUDA graph node local id. CUDA graph node 的 local id。
GetNodeParamsDescriptor(CudaGraphNode)
Gets a copied, pointer-free typed descriptor for supported CUDA graph node parameters. 获取支持的 CUDA graph node 参数的复制型、无指针 typed descriptor。
public static CudaGraphNodeParamsDescriptor GetNodeParamsDescriptor(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe graph-owned node token. Graph 拥有的 node token。
Returns
- CudaGraphNodeParamsDescriptor
A copied node parameter descriptor that never exposes borrowed CUDA handles or native pointers. 不暴露 borrowed CUDA handle 或原生指针的复制型 node 参数 descriptor。
Remarks
This method intentionally collapses event nodes to event-presence booleans and memcpy/memset nodes to copied scalar metadata. 该方法有意将 event node 折叠为 event-presence 布尔值,并将 memcpy/memset node 折叠为复制出的标量 metadata。
GetNodeSnapshotList(ulong)
Gets copied snapshots for graph nodes. 获取 graph node 的复制型快照列表。
public IReadOnlyList<CudaGraphNodeSnapshot> GetNodeSnapshotList(ulong maxNodes = 18446744073709551615)
Parameters
maxNodesulongThe maximum number of nodes to copy. 要复制的最大节点数量。
Returns
- IReadOnlyList<CudaGraphNodeSnapshot>
Bounded node snapshots. 有界 node 快照列表。
GetNodeToolsId(CudaGraphNode)
Gets the CUDA tools id for a graph node when supported by the loaded runtime. 在当前 CUDA runtime 支持时获取 graph node 的 tools id。
public static ulong GetNodeToolsId(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe graph node token. graph node 的 token。
Returns
- ulong
The CUDA graph node tools id. CUDA graph node 的 tools id。
GetNodeTopologySnapshot(CudaGraphNode)
Gets a copied topology snapshot for a CUDA graph node token. 获取 CUDA graph node token 的复制型拓扑快照。
public static CudaGraphNodeTopologySnapshot GetNodeTopologySnapshot(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe graph node token. 图节点令牌。
Returns
- CudaGraphNodeTopologySnapshot
A snapshot containing node-level topology counters. 包含 node 级拓扑计数的快照。
Remarks
The node token remains graph-owned; this API only copies scalar diagnostics from CUDA. node token 仍由 graph 拥有;该 API 仅从 CUDA 复制标量诊断信息。
GetNodeType(CudaGraphNode)
Gets the CUDA graph node type for a graph-owned node token. 获取 graph-owned node token 的 CUDA graph node 类型。
public static CudaGraphNodeType GetNodeType(CudaGraphNode node)
Parameters
nodeCudaGraphNodeThe node token. 节点 token。
Returns
- CudaGraphNodeType
The CUDA graph node type. CUDA graph node 类型。
GetRootNode(ulong)
Gets a root node token by index from this graph. 按索引获取当前 graph 中的 root node token。
public CudaGraphNode GetRootNode(ulong index)
Parameters
indexulongThe zero-based root node index. 从零开始的 root node 索引。
Returns
- CudaGraphNode
A graph-owned node token. 由 graph 拥有的 node token。
GetRootNodeSnapshotList(ulong)
Gets copied snapshots for root graph nodes. 获取 root graph node 的复制型快照列表。
public IReadOnlyList<CudaGraphNodeSnapshot> GetRootNodeSnapshotList(ulong maxNodes = 18446744073709551615)
Parameters
maxNodesulongThe maximum number of root nodes to copy. 要复制的最大 root 节点数量。
Returns
- IReadOnlyList<CudaGraphNodeSnapshot>
Bounded root-node snapshots. 有界 root-node 快照列表。
GetTopologySnapshot()
Gets a copied topology snapshot for this CUDA graph. 获取当前 CUDA graph 的复制型拓扑快照。
public CudaGraphTopologySnapshot GetTopologySnapshot()
Returns
- CudaGraphTopologySnapshot
A snapshot containing graph-level topology counters. 包含 graph 级拓扑计数的快照。
Remarks
The snapshot contains copied scalar values only and does not expose borrowed CUDA pointers. 该快照仅包含复制出的标量值,不暴露借用的 CUDA 指针。
Instantiate(ulong)
Instantiates this graph as an executable CUDA graph. 将当前 graph 实例化为可执行 CUDA graph。
public CudaGraphExec Instantiate(ulong flags = 0)
Parameters
flagsulongThe CUDA graph-instantiation flags. CUDA graph 实例化标志。
Returns
- CudaGraphExec
A managed executable graph wrapper. 可执行 graph 的托管封装。
InstantiateWithParameters(CudaStream, ulong)
Instantiates and uploads this graph through CUDA's parameterized instantiation API. 通过 CUDA 参数化实例化 API 实例化并上传当前 graph。
public CudaGraphExec InstantiateWithParameters(CudaStream uploadStream, ulong flags = 0)
Parameters
uploadStreamCudaStreamThe managed stream used for upload. 用于 upload 的托管 stream。
flagsulongCUDA graph instantiation flags. CUDA graph 实例化标志。
Returns
- CudaGraphExec
A managed executable graph. 托管 executable graph。
InstantiateWithParameters(ulong)
Instantiates this graph through CUDA's parameterized instantiation API. 通过 CUDA 参数化实例化 API 将当前 graph 实例化。
public CudaGraphExec InstantiateWithParameters(ulong flags = 0)
Parameters
flagsulongCUDA graph instantiation flags. CUDA graph 实例化标志。
Returns
- CudaGraphExec
A managed executable graph. 托管 executable graph。
RemoveDependency(CudaGraphNode, CudaGraphNode)
Removes a dependency edge between two nodes in this graph. 删除当前 graph 的两个节点之间的依赖边。
public void RemoveDependency(CudaGraphNode fromNode, CudaGraphNode toNode)
Parameters
fromNodeCudaGraphNodeThe source node. 源节点。
toNodeCudaGraphNodeThe destination node. 目标节点。
RemoveDependency(CudaGraphNode, CudaGraphNode, CudaGraphEdgeData)
Removes a dependency edge with explicit CUDA edge data. 使用显式 CUDA edge data 删除两个节点之间的依赖边。
public void RemoveDependency(CudaGraphNode fromNode, CudaGraphNode toNode, CudaGraphEdgeData edgeData)
Parameters
fromNodeCudaGraphNodeThe source node. 源节点。
toNodeCudaGraphNodeThe destination node. 目标节点。
edgeDataCudaGraphEdgeDataThe CUDA graph edge data. CUDA graph 边数据。
RemoveNode(CudaGraphNode)
Removes a node after verifying that it belongs to this graph. 在确认节点属于当前 graph 后将其删除。
public void RemoveNode(CudaGraphNode node)
Parameters
nodeCudaGraphNode
SetDeviceToDeviceMemcpyNodeParameters(CudaGraphNode, CudaMemory, CudaMemory, int)
Updates a CUDA graph memcpy node for a 1D device-to-device copy. 将 CUDA graph memcpy 节点更新为 1D device-to-device 复制。
public static void SetDeviceToDeviceMemcpyNodeParameters(CudaGraphNode node, CudaMemory destination, CudaMemory source, int count)
Parameters
nodeCudaGraphNodeThe memcpy node token. memcpy 节点 token。
destinationCudaMemoryThe destination device memory owner. 目标设备内存所有者。
sourceCudaMemoryThe source device memory owner. 源设备内存所有者。
countintThe byte count to copy. 要复制的字节数。
Remarks
This method derives native pointers from managed memory owners and validates count against both allocations.
该方法从托管内存所有者推导 native 指针,并按两个分配的大小校验 count。
SetDeviceToHostMemcpyNodeParameters(CudaGraphNode, CudaPinnedMemory, CudaMemory, int)
Updates a CUDA graph memcpy node for a 1D device-to-pinned-host copy. 将 CUDA graph memcpy 节点更新为 1D device-to-pinned-host 复制。
public static void SetDeviceToHostMemcpyNodeParameters(CudaGraphNode node, CudaPinnedMemory destination, CudaMemory source, int count)
Parameters
nodeCudaGraphNodeThe memcpy node token. memcpy 节点 token。
destinationCudaPinnedMemoryThe destination pinned host memory owner. 目标 pinned host memory 所有者。
sourceCudaMemoryThe source device memory owner. 源设备内存所有者。
countintThe byte count to copy. 要复制的字节数。
Remarks
This method derives native pointers from managed memory owners and validates count against both allocations.
该方法从托管内存所有者推导 native 指针,并按两个分配的大小校验 count。
SetEventRecordNodeEvent(CudaGraphNode, CudaEvent)
Updates an event-record node to use a caller-owned CUDA event. 将 event-record 节点更新为使用调用方拥有的 CUDA event。
public static void SetEventRecordNodeEvent(CudaGraphNode node, CudaEvent eventHandle)
Parameters
nodeCudaGraphNodeThe event-record node token. event-record 节点 token。
eventHandleCudaEventThe caller-owned CUDA event. 调用方拥有的 CUDA event。
Remarks
The event must remain alive while the graph or any executable graph created from it may use this node. 该 event 必须在 graph 或由该 graph 创建的 executable graph 可能使用该节点期间保持存活。
SetEventWaitNodeEvent(CudaGraphNode, CudaEvent)
Updates an event-wait node to use a caller-owned CUDA event. 将 event-wait 节点更新为使用调用方拥有的 CUDA event。
public static void SetEventWaitNodeEvent(CudaGraphNode node, CudaEvent eventHandle)
Parameters
nodeCudaGraphNodeThe event-wait node token. event-wait 节点 token。
eventHandleCudaEventThe caller-owned CUDA event. 调用方拥有的 CUDA event。
Remarks
The event must remain alive while the graph or any executable graph created from it may use this node. 该 event 必须在 graph 或由该 graph 创建的 executable graph 可能使用该节点期间保持存活。
SetHostToDeviceMemcpyNodeParameters(CudaGraphNode, CudaMemory, CudaPinnedMemory, int)
Updates a CUDA graph memcpy node for a 1D pinned-host-to-device copy. 将 CUDA graph memcpy 节点更新为 1D pinned-host-to-device 复制。
public static void SetHostToDeviceMemcpyNodeParameters(CudaGraphNode node, CudaMemory destination, CudaPinnedMemory source, int count)
Parameters
nodeCudaGraphNodeThe memcpy node token. memcpy 节点 token。
destinationCudaMemoryThe destination device memory owner. 目标设备内存所有者。
sourceCudaPinnedMemoryThe source pinned host memory owner. 源 pinned host memory 所有者。
countintThe byte count to copy. 要复制的字节数。
Remarks
This method derives native pointers from managed memory owners and validates count against both allocations.
该方法从托管内存所有者推导 native 指针,并按两个分配的大小校验 count。
SetKernelNodeAttribute(CudaGraphNode, CudaGraphKernelNodeAttributeValue)
Updates a CUDA graph kernel node scalar attribute using a typed descriptor. 使用 typed descriptor 更新 CUDA graph kernel 节点的标量 attribute。
public static void SetKernelNodeAttribute(CudaGraphNode node, CudaGraphKernelNodeAttributeValue value)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
valueCudaGraphKernelNodeAttributeValueThe scalar attribute descriptor. 标量 attribute descriptor。
Remarks
This method does not accept raw kernel parameters, function pointers, callback user data, or CUDA's native union. 该方法不接受裸 kernel 参数、function pointer、callback user data 或 CUDA 原生 union。
SetKernelNodeClusterDimension(CudaGraphNode, uint, uint, uint)
Updates a CUDA graph kernel node cluster dimension. 更新 CUDA graph kernel 节点 cluster dimension。
public static void SetKernelNodeClusterDimension(CudaGraphNode node, uint x, uint y, uint z)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
xuintThe cluster X dimension. Cluster X 维度。
yuintThe cluster Y dimension. Cluster Y 维度。
zuintThe cluster Z dimension. Cluster Z 维度。
SetKernelNodeClusterSchedulingPolicy(CudaGraphNode, CudaClusterSchedulingPolicyPreference)
Updates a CUDA graph kernel node cluster scheduling policy preference. 更新 CUDA graph kernel 节点 cluster scheduling policy preference。
public static void SetKernelNodeClusterSchedulingPolicy(CudaGraphNode node, CudaClusterSchedulingPolicyPreference policy)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
policyCudaClusterSchedulingPolicyPreferenceThe cluster scheduling policy preference. Cluster 调度策略偏好。
SetKernelNodeCooperative(CudaGraphNode, bool)
Updates a CUDA graph kernel node cooperative flag. 更新 CUDA graph kernel 节点 cooperative 标志。
public static void SetKernelNodeCooperative(CudaGraphNode node, bool enabled)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
enabledboolWhether cooperative launch is enabled. 是否启用 cooperative launch。
SetKernelNodePriority(CudaGraphNode, int)
Updates a CUDA graph kernel node priority. 更新 CUDA graph kernel 节点 priority。
public static void SetKernelNodePriority(CudaGraphNode node, int priority)
Parameters
nodeCudaGraphNodeThe kernel node token. kernel 节点 token。
priorityintThe kernel execution priority. Kernel 执行优先级。
SetMemsetNodeParameters(CudaGraphNode, CudaMemory, byte, int)
Updates a CUDA graph memset node using a managed device-memory owner and byte-count descriptor. 使用托管设备内存所有者和字节数 descriptor 更新 CUDA graph memset 节点。
public static void SetMemsetNodeParameters(CudaGraphNode node, CudaMemory destination, byte value, int count)
Parameters
nodeCudaGraphNodeThe memset node token. memset 节点 token。
destinationCudaMemoryThe destination device memory owner. 目标设备内存所有者。
valuebyteThe byte value used by the memset node. memset 节点使用的字节填充值。
countintThe number of bytes to fill. 要填充的字节数。
Remarks
This method does not accept raw device pointers. The native bridge derives the destination pointer from destination and validates count against the allocation size.
该方法不接受裸设备指针。Native bridge 会从 destination 推导目标指针,并按分配大小校验 count。