Table of Contents

Class KernelExecutionResult

Namespace
DotCompute.Abstractions.Ports
Assembly
DotCompute.Abstractions.dll

Result of kernel execution.

public sealed record KernelExecutionResult : IEquatable<KernelExecutionResult>
Inheritance
KernelExecutionResult
Implements
Inherited Members

Properties

Duration

Execution duration.

public TimeSpan Duration { get; init; }

Property Value

TimeSpan

ErrorMessage

Error message if failed.

public string? ErrorMessage { get; init; }

Property Value

string

GpuDuration

GPU-side duration if available.

public TimeSpan? GpuDuration { get; init; }

Property Value

TimeSpan?

Success

Whether execution succeeded.

public required bool Success { get; init; }

Property Value

bool

Methods

Failed(string)

Creates a failed result.

public static KernelExecutionResult Failed(string error)

Parameters

error string

Returns

KernelExecutionResult

Succeeded(TimeSpan, TimeSpan?)

Creates a successful result.

public static KernelExecutionResult Succeeded(TimeSpan duration, TimeSpan? gpuDuration = null)

Parameters

duration TimeSpan
gpuDuration TimeSpan?

Returns

KernelExecutionResult