Class MetalMPSOrchestrator
- Namespace
- DotCompute.Backends.Metal.MPS
- Assembly
- DotCompute.Backends.Metal.dll
Intelligent orchestrator that automatically selects between MPS and custom kernels based on operation type, data size, and device capabilities.
public sealed class MetalMPSOrchestrator : IDisposable
- Inheritance
-
MetalMPSOrchestrator
- Implements
- Inherited Members
- Extension Methods
Constructors
MetalMPSOrchestrator(nint, ILogger<MetalMPSOrchestrator>)
public MetalMPSOrchestrator(nint device, ILogger<MetalMPSOrchestrator> logger)
Parameters
devicenintloggerILogger<MetalMPSOrchestrator>
Properties
Metrics
Gets performance metrics for MPS vs CPU operations.
public PerformanceMetrics Metrics { get; }
Property Value
Methods
Convolution2D(ReadOnlySpan<float>, int, int, int, ReadOnlySpan<float>, int, int, int, Span<float>, int, int, int, int, int, int)
Performs convolution with automatic backend selection.
public void Convolution2D(ReadOnlySpan<float> input, int inputHeight, int inputWidth, int inputChannels, ReadOnlySpan<float> kernel, int kernelHeight, int kernelWidth, int outputChannels, Span<float> output, int outputHeight, int outputWidth, int strideY = 1, int strideX = 1, int paddingY = 0, int paddingX = 0)
Parameters
inputReadOnlySpan<float>inputHeightintinputWidthintinputChannelsintkernelReadOnlySpan<float>kernelHeightintkernelWidthintoutputChannelsintoutputSpan<float>outputHeightintoutputWidthintstrideYintstrideXintpaddingYintpaddingXint
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
MatrixMultiply(ReadOnlySpan<float>, int, int, ReadOnlySpan<float>, int, int, Span<float>, int, int, float, float, bool, bool)
Performs matrix multiplication with automatic backend selection.
public void MatrixMultiply(ReadOnlySpan<float> a, int rowsA, int colsA, ReadOnlySpan<float> b, int rowsB, int colsB, Span<float> c, int rowsC, int colsC, float alpha = 1, float beta = 0, bool transposeA = false, bool transposeB = false)
Parameters
aReadOnlySpan<float>rowsAintcolsAintbReadOnlySpan<float>rowsBintcolsBintcSpan<float>rowsCintcolsCintalphafloatbetafloattransposeAbooltransposeBbool
ReLU(ReadOnlySpan<float>, Span<float>)
Applies ReLU activation with automatic backend selection.
public void ReLU(ReadOnlySpan<float> input, Span<float> output)
Parameters
inputReadOnlySpan<float>outputSpan<float>