Table of Contents

Class ContextOptions

Namespace
Orleans.GpuBridge.Abstractions.Models
Assembly
Orleans.GpuBridge.Abstractions.dll

Configuration options for creating a compute context. These options control various aspects of context behavior including debugging, profiling, concurrency, and backend-specific customizations.

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

Constructors

ContextOptions(bool, bool, int, bool, IReadOnlyDictionary<string, object>?)

Configuration options for creating a compute context. These options control various aspects of context behavior including debugging, profiling, concurrency, and backend-specific customizations.

public ContextOptions(bool EnableProfiling = false, bool EnableDebugMode = false, int CommandQueueCount = 1, bool EnableOutOfOrderExecution = false, IReadOnlyDictionary<string, object>? CustomOptions = null)

Parameters

EnableProfiling bool

Indicates whether profiling should be enabled for this context. When enabled, the context will collect timing and performance metrics for kernels and operations executed within the context. This may introduce slight performance overhead but provides valuable debugging and optimization information. Default is false.

EnableDebugMode bool

Indicates whether debug mode should be enabled for this context. Debug mode typically enables additional validation, error checking, and diagnostic information that can help during development. This may significantly impact performance and should only be used during development. Default is false.

CommandQueueCount int

The number of command queues to create for this context. Multiple command queues enable concurrent execution of independent operations and can improve throughput for workloads with multiple parallel streams. Must be at least 1. Default is 1.

EnableOutOfOrderExecution bool

Indicates whether out-of-order execution should be enabled for the context. When enabled, operations may complete in a different order than they were submitted, potentially improving performance through better resource utilization. Applications must handle proper synchronization when this is enabled. Default is false.

CustomOptions IReadOnlyDictionary<string, object>

Backend-specific custom options as key-value pairs. This allows backend providers to accept additional configuration parameters that are not covered by the standard options. The interpretation of these options is specific to each backend implementation. If null, no custom options are applied.

Properties

CommandQueueCount

The number of command queues to create for this context. Multiple command queues enable concurrent execution of independent operations and can improve throughput for workloads with multiple parallel streams. Must be at least 1. Default is 1.

public int CommandQueueCount { get; init; }

Property Value

int

CustomOptions

Backend-specific custom options as key-value pairs. This allows backend providers to accept additional configuration parameters that are not covered by the standard options. The interpretation of these options is specific to each backend implementation. If null, no custom options are applied.

public IReadOnlyDictionary<string, object>? CustomOptions { get; init; }

Property Value

IReadOnlyDictionary<string, object>

EnableDebugMode

Indicates whether debug mode should be enabled for this context. Debug mode typically enables additional validation, error checking, and diagnostic information that can help during development. This may significantly impact performance and should only be used during development. Default is false.

public bool EnableDebugMode { get; init; }

Property Value

bool

EnableOutOfOrderExecution

Indicates whether out-of-order execution should be enabled for the context. When enabled, operations may complete in a different order than they were submitted, potentially improving performance through better resource utilization. Applications must handle proper synchronization when this is enabled. Default is false.

public bool EnableOutOfOrderExecution { get; init; }

Property Value

bool

EnableProfiling

Indicates whether profiling should be enabled for this context. When enabled, the context will collect timing and performance metrics for kernels and operations executed within the context. This may introduce slight performance overhead but provides valuable debugging and optimization information. Default is false.

public bool EnableProfiling { get; init; }

Property Value

bool