Table of Contents

Class CudaGraphInstance

Namespace
DotCompute.Backends.CUDA.Execution.Graph
Assembly
DotCompute.Backends.CUDA.dll

Represents an instantiated CUDA graph that can be executed multiple times with high performance. Provides tracking of execution statistics and resource management for graph instances.

public sealed class CudaGraphInstance : IDisposable
Inheritance
CudaGraphInstance
Implements
Inherited Members
Extension Methods

Remarks

Graph instances are created from graph templates and can be executed repeatedly with minimal overhead. Each instance maintains its own execution statistics and can be updated dynamically.

Properties

CreatedAt

Gets or sets the timestamp when this instance was created.

public DateTimeOffset CreatedAt { get; set; }

Property Value

DateTimeOffset

A DateTimeOffset indicating when the instance was instantiated.

ExecutionCount

Gets or sets the total number of times this instance has been executed.

public int ExecutionCount { get; set; }

Property Value

int

An integer representing the cumulative execution count.

GraphId

Gets or sets the identifier of the parent graph from which this instance was created.

public string GraphId { get; set; }

Property Value

string

A string identifying the parent graph template.

Handle

Gets or sets the native CUDA graph execution handle.

public nint Handle { get; set; }

Property Value

nint

An nint representing the native CUDA graph execution handle.

Id

Gets or sets the unique identifier for this graph instance.

public string Id { get; set; }

Property Value

string

A string that uniquely identifies this graph instance.

IsValid

Gets or sets a value indicating whether this instance is valid and can be executed.

public bool IsValid { get; set; }

Property Value

bool

true if the instance is valid for execution; otherwise, false.

LastExecutedAt

Gets or sets the timestamp of the most recent execution.

public DateTimeOffset? LastExecutedAt { get; set; }

Property Value

DateTimeOffset?

A nullable DateTimeOffset indicating the last execution time, or null if never executed.

LastUpdatedAt

Gets or sets the timestamp of the most recent update.

public DateTimeOffset? LastUpdatedAt { get; set; }

Property Value

DateTimeOffset?

A nullable DateTimeOffset indicating the last update time, or null if never updated.

TotalGpuTime

Gets or sets the cumulative GPU execution time for all executions of this instance.

public float TotalGpuTime { get; set; }

Property Value

float

A float representing the total GPU time in milliseconds.

UpdateCount

Gets or sets the total number of times this instance has been updated.

public int UpdateCount { get; set; }

Property Value

int

An integer representing the cumulative update count.

Methods

Dispose()

Releases the native CUDA graph execution resources.

public void Dispose()

Remarks

This method is called automatically when the instance is disposed. It safely destroys the native CUDA graph execution handle and marks the instance as invalid.