Table of Contents

Class AcceleratorRuntime

Namespace
DotCompute.Runtime
Assembly
DotCompute.Runtime.dll

Main runtime for accelerator management and execution

[SuppressMessage("Performance", "CA1848:Use the LoggerMessage delegates", Justification = "Simple logging in runtime layer")]
public class AcceleratorRuntime : IDisposable, IAsyncDisposable
Inheritance
AcceleratorRuntime
Implements
Inherited Members
Extension Methods

Constructors

AcceleratorRuntime(IServiceProvider, ILogger<AcceleratorRuntime>)

Main runtime for accelerator management and execution

public AcceleratorRuntime(IServiceProvider serviceProvider, ILogger<AcceleratorRuntime> logger)

Parameters

serviceProvider IServiceProvider
logger ILogger<AcceleratorRuntime>

Methods

Dispose()

Disposes of the runtime and all managed accelerators synchronously

public void Dispose()

Dispose(bool)

Protected implementation of Dispose pattern

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

DisposeAsync()

Disposes of the runtime and all managed accelerators asynchronously

public ValueTask DisposeAsync()

Returns

ValueTask

DisposeAsyncCoreAsync()

Protected async implementation of Dispose pattern

protected virtual ValueTask DisposeAsyncCoreAsync()

Returns

ValueTask

GetAccelerator(string)

Get accelerator by type

public IAccelerator? GetAccelerator(string deviceType)

Parameters

deviceType string

Returns

IAccelerator

GetAccelerators()

Get all available accelerators

public IReadOnlyList<IAccelerator> GetAccelerators()

Returns

IReadOnlyList<IAccelerator>

InitializeAsync()

Initialize the runtime and discover available accelerators

public Task InitializeAsync()

Returns

Task