Added missing dots

このコミットが含まれているのは:
Sergio Pedri committed 2020-12-01 19:12:03 +01:00
1 親 e45b712000
コミット 33870886b6
51ファイル変更
+5686 -5686

検索条件に一致するファイルはありません

+20 -20
ファイルの表示
@@ -4,21 +4,21 @@ using System.Threading.Tasks;
namespace ComputeSharp.Benchmark
{
/// <summary>
/// A <see langword="class"/> that contains primitives to run certain operations of a neural network
/// A <see langword="class"/> that contains primitives to run certain operations of a neural network.
/// </summary>
internal static partial class Dnn
{
/// <summary>
/// Executes the forward pass on a fully connected layer on the CPU
/// Executes the forward pass on a fully connected layer on the CPU.
/// </summary>
/// <param name="c">The number of samples in the input tensor</param>
/// <param name="n">The number of rows in the input matrix</param>
/// <param name="m">The number of columns in the input matrix</param>
/// <param name="p">The number of columns in the output matrix</param>
/// <param name="x">The input tensor</param>
/// <param name="w">The weights tensor</param>
/// <param name="b">The bias tensor</param>
/// <param name="y">The result tensor</param>
/// <param name="c">The number of samples in the input tensor.</param>
/// <param name="n">The number of rows in the input matrix.</param>
/// <param name="m">The number of columns in the input matrix.</param>
/// <param name="p">The number of columns in the output matrix.</param>
/// <param name="x">The input tensor.</param>
/// <param name="w">The weights tensor.</param>
/// <param name="b">The bias tensor.</param>
/// <param name="y">The result tensor.</param>
public static void FullyConnectedForwardCpu(int c, int n, int m, int p, float[] x, float[] w, float[] b, float[] y)
{
void Kernel(int s)
@@ -51,16 +51,16 @@ namespace ComputeSharp.Benchmark
}
/// <summary>
/// Executes the forward pass on a fully connected layer on the GPU
/// Executes the forward pass on a fully connected layer on the GPU.
/// </summary>
/// <param name="c">The number of samples in the input tensor</param>
/// <param name="n">The number of rows in the input matrix</param>
/// <param name="m">The number of columns in the input matrix</param>
/// <param name="p">The number of columns in the output matrix</param>
/// <param name="x">The input tensor</param>
/// <param name="w">The weights tensor</param>
/// <param name="b">The bias tensor</param>
/// <param name="y">The result tensor</param>
/// <param name="c">The number of samples in the input tensor.</param>
/// <param name="n">The number of rows in the input matrix.</param>
/// <param name="m">The number of columns in the input matrix.</param>
/// <param name="p">The number of columns in the output matrix.</param>
/// <param name="x">The input tensor.</param>
/// <param name="w">The weights tensor.</param>
/// <param name="b">The bias tensor.</param>
/// <param name="y">The result tensor.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void FullyConnectedForwardGpu(
int c, int n, int m, int p,
@@ -70,7 +70,7 @@ namespace ComputeSharp.Benchmark
}
/// <summary>
/// Kernel for <see cref="FullyConnectedForwardGpu"/>
/// Kernel for <see cref="FullyConnectedForwardGpu"/>.
/// </summary>
[AutoConstructor]
private readonly partial struct FullyConnectedForwardKernel : IComputeShader
+20 -20
ファイルの表示
@@ -7,17 +7,17 @@ using BenchmarkDotNet.Attributes;
namespace ComputeSharp.Benchmark
{
/// <summary>
/// A <see langword="class"/> that benchmarks the APIs in the <see cref="Dnn"/> class, on both CPU and GPU
/// A <see langword="class"/> that benchmarks the APIs in the <see cref="Dnn"/> class, on both CPU and GPU.
/// </summary>
public class DnnBenchmark : IDisposable
{
/// <summary>
/// The number of samples
/// The number of samples.
/// </summary>
private const int C = 128;
/// <summary>
/// The nummber of rows in the <see cref="X"/> matrix
/// The nummber of rows in the <see cref="X"/> matrix.
/// </summary>
private const int N = 512;
@@ -27,57 +27,57 @@ namespace ComputeSharp.Benchmark
private const int M = 512;
/// <summary>
/// The number of columns in the <see cref="W"/> matrix
/// The number of columns in the <see cref="W"/> matrix.
/// </summary>
private const int P = 256;
/// <summary>
/// The input tensor
/// The input tensor.
/// </summary>
private float[] X;
/// <summary>
/// The weights tensor
/// The weights tensor.
/// </summary>
private float[] W;
/// <summary>
/// The bias tensor
/// The bias tensor.
/// </summary>
private float[] B;
/// <summary>
/// The result tensor
/// The result tensor.
/// </summary>
private float[] Y;
/// <summary>
/// The input tensor
/// The input tensor.
/// </summary>
private ReadOnlyBuffer<float> BufferX;
/// <summary>
/// The weights tensor
/// The weights tensor.
/// </summary>
private ReadOnlyBuffer<float> BufferW;
/// <summary>
/// The bias tensor
/// The bias tensor.
/// </summary>
private ReadOnlyBuffer<float> BufferB;
/// <summary>
/// The result tensor
/// The result tensor.
/// </summary>
private ReadWriteBuffer<float> BufferY;
/// <summary>
/// A <see cref="System.Random"/> instance to initialize the tensors
/// A <see cref="System.Random"/> instance to initialize the tensors.
/// </summary>
private readonly Random Random = new Random();
/// <summary>
/// Initial setup for a benchmarking session
/// Initial setup for a benchmarking session.
/// </summary>
[GlobalSetup]
public void Setup()
@@ -94,7 +94,7 @@ namespace ComputeSharp.Benchmark
}
/// <summary>
/// Clears the memory from the current session
/// Clears the memory from the current session.
/// </summary>
[GlobalCleanup]
public void Dispose()
@@ -111,9 +111,9 @@ namespace ComputeSharp.Benchmark
}
/// <summary>
/// Creates a new <see langword="float"/> array of the specified size
/// Creates a new <see langword="float"/> array of the specified size.
/// </summary>
/// <param name="size">The size of the new random array to create</param>
/// <param name="size">The size of the new random array to create.</param>
[Pure]
private float[] CreateRandomArray(int size)
{
@@ -128,19 +128,19 @@ namespace ComputeSharp.Benchmark
}
/// <summary>
/// Runs a fully connected forward operation on the CPU
/// Runs a fully connected forward operation on the CPU.
/// </summary>
[Benchmark(Baseline = true)]
public void Cpu() => Dnn.FullyConnectedForwardCpu(C, N, M, P, X, W, B, Y);
/// <summary>
/// Runs a fully connected forward operation on the GPU
/// Runs a fully connected forward operation on the GPU.
/// </summary>
[Benchmark]
public void GpuWithNoTemporaryBuffers() => Dnn.FullyConnectedForwardGpu(C, N, M, P, BufferX, BufferW, BufferB, BufferY);
/// <summary>
/// Runs a fully connected forward operation on the GPU, creating temporary GPU buffers to perform the operations
/// Runs a fully connected forward operation on the GPU, creating temporary GPU buffers to perform the operations.
/// </summary>
[Benchmark]
public void GpuWithTemporaryBuffers()
+3 -3
ファイルの表示
@@ -14,12 +14,12 @@ namespace SixLabors.ImageSharp
internal readonly struct Complex64
{
/// <summary>
/// The real part of the complex number
/// The real part of the complex number.
/// </summary>
public readonly float Real;
/// <summary>
/// The imaginary part of the complex number
/// The imaginary part of the complex number.
/// </summary>
public readonly float Imaginary;
@@ -39,7 +39,7 @@ namespace SixLabors.ImageSharp
/// </summary>
/// <param name="value">The <see cref="Complex64"/> value to multiply.</param>
/// <param name="scalar">The <see cref="float"/> scalar to use to multiply the <see cref="Complex64"/> value.</param>
/// <returns>The <see cref="Complex64"/> result</returns>
/// <returns>The <see cref="Complex64"/> result.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Complex64 operator *(Complex64 value, float scalar) => new Complex64(value.Real * scalar, value.Imaginary * scalar);
}
+2 -2
ファイルの表示
@@ -11,12 +11,12 @@ namespace SixLabors.ImageSharp
internal struct ComplexVector4
{
/// <summary>
/// The real part of the complex vector
/// The real part of the complex vector.
/// </summary>
public Vector4 Real;
/// <summary>
/// The imaginary part of the complex number
/// The imaginary part of the complex number.
/// </summary>
public Vector4 Imaginary;
}
+12 -12
ファイルの表示
@@ -5,36 +5,36 @@ using SixLabors.ImageSharp.Processing.Processors;
namespace ComputeSharp.BokehBlur.Processors
{
/// <summary>
/// Applies bokeh blur processing to the image
/// Applies bokeh blur processing to the image.
/// </summary>
public sealed class HlslBokehBlurProcessor : IImageProcessor
{
/// <summary>
/// The default radius used by the parameterless constructor
/// The default radius used by the parameterless constructor.
/// </summary>
public const int DefaultRadius = 32;
/// <summary>
/// The default component count used by the parameterless constructor
/// The default component count used by the parameterless constructor.
/// </summary>
public const int DefaultComponents = 2;
/// <summary>
/// The default gamma used by the parameterless constructor
/// The default gamma used by the parameterless constructor.
/// </summary>
public const float DefaultGamma = 3f;
/// <summary>
/// Initializes a new instance of the <see cref="HlslBokehBlurProcessor"/> class
/// Initializes a new instance of the <see cref="HlslBokehBlurProcessor"/> class.
/// </summary>
public HlslBokehBlurProcessor() : this(DefaultRadius, DefaultComponents, DefaultGamma) { }
/// <summary>
/// Initializes a new instance of the <see cref="HlslBokehBlurProcessor"/> class
/// Initializes a new instance of the <see cref="HlslBokehBlurProcessor"/> class.
/// </summary>
/// <param name="radius">The size of the area to sample</param>
/// <param name="components">The number of components to use to approximate the original 2D bokeh blur convolution kernel</param>
/// <param name="gamma">The gamma highlight factor to use to further process the image</param>
/// <param name="radius">The size of the area to sample.</param>
/// <param name="components">The number of components to use to approximate the original 2D bokeh blur convolution kernel.</param>
/// <param name="gamma">The gamma highlight factor to use to further process the image.</param>
public HlslBokehBlurProcessor(int radius, int components, float gamma)
{
Radius = radius;
@@ -43,17 +43,17 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Gets the radius
/// Gets the radius.
/// </summary>
public int Radius { get; }
/// <summary>
/// Gets the number of components
/// Gets the number of components.
/// </summary>
public int Components { get; }
/// <summary>
/// Gets the gamma highlight factor to use when applying the effect
/// Gets the gamma highlight factor to use when applying the effect.
/// </summary>
public float Gamma { get; }
+41 -41
ファイルの表示
@@ -14,30 +14,30 @@ using SixLabors.ImageSharp.Processing.Processors;
namespace ComputeSharp.BokehBlur.Processors
{
/// <summary>
/// Applies bokeh blur processing to the image
/// Applies bokeh blur processing to the image.
/// </summary>
/// <typeparam name="TPixel">The pixel format</typeparam>
/// <remarks>This processor is based on the code from Mike Pound, see <a href="https://github.com/mikepound/convolve">github.com/mikepound/convolve</a></remarks>
/// <typeparam name="TPixel">The pixel format.</typeparam>
/// <remarks>This processor is based on the code from Mike Pound, see <a href="https://github.com/mikepound/convolve">github.com/mikepound/convolve</a>.</remarks>
public sealed partial class HlslBokehBlurProcessor<TPixel> : ImageProcessor<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
/// <summary>
/// The kernel radius
/// The kernel radius.
/// </summary>
private readonly int Radius;
/// <summary>
/// The gamma highlight factor to use when applying the effect
/// The gamma highlight factor to use when applying the effect.
/// </summary>
private readonly float Gamma;
/// <summary>
/// The maximum size of the kernel in either direction
/// The maximum size of the kernel in either direction.
/// </summary>
private readonly int KernelSize;
/// <summary>
/// The number of components to use when applying the bokeh blur
/// The number of components to use when applying the bokeh blur.
/// </summary>
private readonly int ComponentsCount;
@@ -47,27 +47,27 @@ namespace ComputeSharp.BokehBlur.Processors
private readonly Vector4[] KernelParameters;
/// <summary>
/// The kernel components for the current instance
/// The kernel components for the current instance.
/// </summary>
private readonly Complex64[][] Kernels;
/// <summary>
/// The scaling factor for kernel values
/// The scaling factor for kernel values.
/// </summary>
private readonly float KernelsScale;
/// <summary>
/// The mapping of initialized complex kernels and parameters, to speed up the initialization of new <see cref="HlslBokehBlurProcessor{TPixel}"/> instances
/// The mapping of initialized complex kernels and parameters, to speed up the initialization of new <see cref="HlslBokehBlurProcessor{TPixel}"/> instances.
/// </summary>
private static readonly ConcurrentDictionary<(int Radius, int ComponentsCount), (Vector4[] Parameters, float Scale, Complex64[][] Kernels)> Cache = new();
/// <summary>
/// Initializes a new instance of the <see cref="HlslBokehBlurProcessor{TPixel}"/> class
/// Initializes a new instance of the <see cref="HlslBokehBlurProcessor{TPixel}"/> class.
/// </summary>
/// <param name="definition">The <see cref="HlslBokehBlurProcessor"/> defining the processor parameters</param>
/// <param name="configuration">The configuration which allows altering default behaviour or extending the library</param>
/// <param name="source">The source <see cref="Image{TPixel}"/> instance to modify</param>
/// <param name="sourceRectangle">The source <see cref="Rectangle"/> that indicates the area to edit</param>
/// <param name="definition">The <see cref="HlslBokehBlurProcessor"/> defining the processor parameters.</param>
/// <param name="configuration">The configuration which allows altering default behaviour or extending the library.</param>
/// <param name="source">The source <see cref="Image{TPixel}"/> instance to modify.</param>
/// <param name="sourceRectangle">The source <see cref="Rectangle"/> that indicates the area to edit.</param>
public HlslBokehBlurProcessor(HlslBokehBlurProcessor definition, Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle)
: base(configuration, source, sourceRectangle)
{
@@ -97,12 +97,12 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Gets the kernel scales to adjust the component values in each kernel
/// Gets the kernel scales to adjust the component values in each kernel.
/// </summary>
private static IReadOnlyList<float> KernelScales { get; } = new[] { 1.4f, 1.2f, 1.2f, 1.2f, 1.2f, 1.2f };
/// <summary>
/// Gets the available bokeh blur kernel parameters
/// Gets the available bokeh blur kernel parameters.
/// </summary>
private static IReadOnlyList<Vector4[]> KernelComponents { get; } = new[]
{
@@ -156,7 +156,7 @@ namespace ComputeSharp.BokehBlur.Processors
};
/// <summary>
/// Gets the kernel parameters and scaling factor for the current count value in the current instance
/// Gets the kernel parameters and scaling factor for the current count value in the current instance.
/// </summary>
private (Vector4[] Parameters, float Scale) GetParameters()
{
@@ -166,7 +166,7 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Creates the collection of complex 1D kernels with the specified parameters
/// Creates the collection of complex 1D kernels with the specified parameters.
/// </summary>
private Complex64[][] CreateComplexKernels()
{
@@ -182,10 +182,10 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Creates a complex 1D kernel with the specified parameters
/// Creates a complex 1D kernel with the specified parameters.
/// </summary>
/// <param name="a">The exponential parameter for each complex component</param>
/// <param name="b">The angle component for each complex component</param>
/// <param name="a">The exponential parameter for each complex component.</param>
/// <param name="b">The angle component for each complex component.</param>
private Complex64[] CreateComplex1DKernel(float a, float b)
{
var kernel = new Complex64[KernelSize];
@@ -208,7 +208,7 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Normalizes the kernels with respect to A * real + B * imaginary
/// Normalizes the kernels with respect to A * real + B * imaginary.
/// </summary>
private void NormalizeKernels()
{
@@ -287,11 +287,11 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Performs a vertical 1D complex convolution with the specified parameters
/// Performs a vertical 1D complex convolution with the specified parameters.
/// </summary>
/// <param name="source">The source <see cref="ReadOnlyBuffer{T}"/> to read data from</param>
/// <param name="target">The target <see cref="ReadWriteBuffer{T}"/> to write the results to</param>
/// <param name="kernel">The <see cref="ReadOnlyBuffer{T}"/> with the values for the current complex kernel</param>
/// <param name="source">The source <see cref="ReadOnlyBuffer{T}"/> to read data from.</param>
/// <param name="target">The target <see cref="ReadWriteBuffer{T}"/> to write the results to.</param>
/// <param name="kernel">The <see cref="ReadOnlyBuffer{T}"/> with the values for the current complex kernel.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ApplyVerticalConvolution(
ReadOnlyBuffer<Vector4> source,
@@ -314,7 +314,7 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Kernel for <see cref="ApplyVerticalConvolution"/>
/// Kernel for <see cref="ApplyVerticalConvolution"/>.
/// </summary>
[AutoConstructor]
private partial struct VerticalConvolutionProcessor : IComputeShader
@@ -355,13 +355,13 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Performs an horizontal 1D complex convolution with the specified parameters
/// Performs an horizontal 1D complex convolution with the specified parameters.
/// </summary>
/// <param name="source">The source <see cref="ReadWriteBuffer{T}"/> to read data from</param>
/// <param name="target">The target <see cref="ReadWriteBuffer{T}"/> to write the results to</param>
/// <param name="kernel">The <see cref="ReadOnlyBuffer{T}"/> with the values for the current complex kernel</param>
/// <param name="z">The weight factor for the real component of the complex pixel values</param>
/// <param name="w">The weight factor for the imaginary component of the complex pixel values</param>
/// <param name="source">The source <see cref="ReadWriteBuffer{T}"/> to read data from.</param>
/// <param name="target">The target <see cref="ReadWriteBuffer{T}"/> to write the results to.</param>
/// <param name="kernel">The <see cref="ReadOnlyBuffer{T}"/> with the values for the current complex kernel.</param>
/// <param name="z">The weight factor for the real component of the complex pixel values.</param>
/// <param name="w">The weight factor for the imaginary component of the complex pixel values.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ApplyHorizontalConvolutionAndAccumulatePartials(
ReadWriteBuffer<ComplexVector4> source,
@@ -388,7 +388,7 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Kernel for <see cref="ApplyHorizontalConvolutionAndAccumulatePartials"/>
/// Kernel for <see cref="ApplyHorizontalConvolutionAndAccumulatePartials"/>.
/// </summary>
[AutoConstructor]
private partial struct HorizontalConvolutionAndAccumulatePartialsProcessor : IComputeShader
@@ -431,7 +431,7 @@ namespace ComputeSharp.BokehBlur.Processors
/// <summary>
/// Applies the gamma correction/highlight to the input pixel buffer and returns an <see cref="IMemoryOwner{T}"/> instance with <see cref="Vector4"/> values.
/// </summary>
/// <param name="source">The source image</param>
/// <param name="source">The source image.</param>
[Pure]
private IMemoryOwner<Vector4> GetExposedVector4Buffer(Memory<TPixel> source)
{
@@ -450,7 +450,7 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// The processor for <see cref="GetExposedVector4Buffer"/>
/// The processor for <see cref="GetExposedVector4Buffer"/>.
/// </summary>
[AutoConstructor]
private readonly partial struct GetExposedVector4BufferProcessor : IRowOperation
@@ -482,10 +482,10 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Applies the inverse gamma exposure pass to compute the final pixel values for a target image
/// Applies the inverse gamma exposure pass to compute the final pixel values for a target image.
/// </summary>
/// <param name="source">The source <see cref="Vector4"/> buffer to read from</param>
/// <param name="target">The target image</param>
/// <param name="source">The source <see cref="Vector4"/> buffer to read from.</param>
/// <param name="target">The target image.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ApplyInverseGammaExposure(Memory<Vector4> source, Memory<TPixel> target)
{
@@ -500,7 +500,7 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// The processor for <see cref="ApplyInverseGammaExposure"/>
/// The processor for <see cref="ApplyInverseGammaExposure"/>.
/// </summary>
[AutoConstructor]
private readonly partial struct ApplyInverseGammaExposureProcessor : IRowOperation
+8 -8
ファイルの表示
@@ -5,7 +5,7 @@ using SixLabors.ImageSharp.Processing.Processors;
namespace ComputeSharp.BokehBlur.Processors
{
/// <summary>
/// Defines Gaussian blur by a (Sigma, Radius) pair
/// Defines Gaussian blur by a (Sigma, Radius) pair.
/// </summary>
public sealed class HlslGaussianBlurProcessor : IImageProcessor
{
@@ -15,20 +15,20 @@ namespace ComputeSharp.BokehBlur.Processors
public const float DefaultSigma = 3f;
/// <summary>
/// Initializes a new instance of the <see cref="HlslGaussianBlurProcessor"/> class
/// Initializes a new instance of the <see cref="HlslGaussianBlurProcessor"/> class.
/// </summary>
public HlslGaussianBlurProcessor() : this(DefaultSigma, 9) { }
/// <summary>
/// Initializes a new instance of the <see cref="HlslGaussianBlurProcessor"/> class
/// Initializes a new instance of the <see cref="HlslGaussianBlurProcessor"/> class.
/// </summary>
/// <param name="radius">The radius value representing the size of the area to sample</param>
/// <param name="radius">The radius value representing the size of the area to sample.</param>
public HlslGaussianBlurProcessor(int radius) : this(radius / 3F, radius) { }
/// <summary>
/// Initializes a new instance of the <see cref="HlslGaussianBlurProcessor"/> class
/// Initializes a new instance of the <see cref="HlslGaussianBlurProcessor"/> class.
/// </summary>
/// <param name="sigma"> The sigma value representing the weight of the blur </param>
/// <param name="sigma"> The sigma value representing the weight of the blur. </param>
/// <param name="radius">The radius value representing the size of the area to sample (this should be at least twice the sigma value)</param>
public HlslGaussianBlurProcessor(float sigma, int radius)
{
@@ -37,12 +37,12 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Gets the sigma value representing the weight of the blur
/// Gets the sigma value representing the weight of the blur.
/// </summary>
public float Sigma { get; }
/// <summary>
/// Gets the radius defining the size of the area to sample
/// Gets the radius defining the size of the area to sample.
/// </summary>
public int Radius { get; }
+19 -19
ファイルの表示
@@ -17,17 +17,17 @@ namespace ComputeSharp.BokehBlur.Processors
where TPixel : unmanaged, IPixel<TPixel>
{
/// <summary>
/// The 1D kernel to apply
/// The 1D kernel to apply.
/// </summary>
private readonly float[] Kernel;
/// <summary>
/// Initializes a new instance of the <see cref="HlslGaussianBlurProcessor"/> class
/// Initializes a new instance of the <see cref="HlslGaussianBlurProcessor"/> class.
/// </summary>
/// <param name="definition">The <see cref="HlslGaussianBlurProcessor"/> defining the processor parameters</param>
/// <param name="configuration">The configuration which allows altering default behaviour or extending the library</param>
/// <param name="source">The source <see cref="Image{TPixel}"/> for the current processor instance</param>
/// <param name="sourceRectangle">The source area to process for the current processor instance</param>
/// <param name="definition">The <see cref="HlslGaussianBlurProcessor"/> defining the processor parameters.</param>
/// <param name="configuration">The configuration which allows altering default behaviour or extending the library.</param>
/// <param name="source">The source <see cref="Image{TPixel}"/> for the current processor instance.</param>
/// <param name="sourceRectangle">The source area to process for the current processor instance.</param>
public HlslGaussianBlurProcessor(HlslGaussianBlurProcessor definition, Configuration configuration, Image<TPixel> source, Rectangle sourceRectangle)
: base(configuration, source, sourceRectangle)
{
@@ -36,7 +36,7 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Creates a 1 dimensional Gaussian kernel using the Gaussian G(x) function
/// Creates a 1 dimensional Gaussian kernel using the Gaussian G(x) function.
/// </summary>
private static float[] CreateGaussianBlurKernel(int size, float weight)
{
@@ -64,10 +64,10 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Implementation of 1D Gaussian G(x) function
/// Implementation of 1D Gaussian G(x) function.
/// </summary>
/// <param name="x">The x provided to G(x)</param>
/// <param name="sigma">The spread of the blur</param>
/// <param name="sigma">The spread of the blur.</param>
/// <returns>The Gaussian G(x)</returns>
private static float Gaussian(float x, float sigma)
{
@@ -110,11 +110,11 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Performs a vertical 1D complex convolution with the specified parameters
/// Performs a vertical 1D complex convolution with the specified parameters.
/// </summary>
/// <param name="source">The source <see cref="ReadWriteBuffer{T}"/> to read data from</param>
/// <param name="target">The target <see cref="ReadWriteBuffer{T}"/> to write the results to</param>
/// <param name="kernel">The <see cref="ReadOnlyBuffer{T}"/> with the values for the current complex kernel</param>
/// <param name="source">The source <see cref="ReadWriteBuffer{T}"/> to read data from.</param>
/// <param name="target">The target <see cref="ReadWriteBuffer{T}"/> to write the results to.</param>
/// <param name="kernel">The <see cref="ReadOnlyBuffer{T}"/> with the values for the current complex kernel.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ApplyVerticalConvolution(
ReadWriteBuffer<Vector4> source,
@@ -137,7 +137,7 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Kernel for <see cref="ApplyVerticalConvolution"/>
/// Kernel for <see cref="ApplyVerticalConvolution"/>.
/// </summary>
private struct VerticalConvolutionProcessor : IComputeShader
{
@@ -172,11 +172,11 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Performs an horizontal 1D complex convolution with the specified parameters
/// Performs an horizontal 1D complex convolution with the specified parameters.
/// </summary>
/// <param name="source">The source <see cref="ReadWriteBuffer{T}"/> to read data from</param>
/// <param name="target">The target <see cref="ReadWriteBuffer{T}"/> to write the results to</param>
/// <param name="kernel">The <see cref="ReadOnlyBuffer{T}"/> with the values for the current complex kernel</param>
/// <param name="source">The source <see cref="ReadWriteBuffer{T}"/> to read data from.</param>
/// <param name="target">The target <see cref="ReadWriteBuffer{T}"/> to write the results to.</param>
/// <param name="kernel">The <see cref="ReadOnlyBuffer{T}"/> with the values for the current complex kernel.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void ApplyHorizontalConvolution(
ReadWriteBuffer<Vector4> source,
@@ -199,7 +199,7 @@ namespace ComputeSharp.BokehBlur.Processors
}
/// <summary>
/// Kernel for <see cref="ApplyHorizontalConvolution"/>
/// Kernel for <see cref="ApplyHorizontalConvolution"/>.
/// </summary>
private struct HorizontalConvolutionProcessor : IComputeShader
{
+5 -5
ファイルの表示
@@ -39,7 +39,7 @@ namespace ComputeSharp.Sample
}
/// <summary>
/// Kernel for <see cref="Main"/>
/// Kernel for <see cref="Main"/>.
/// </summary>
[AutoConstructor]
private readonly partial struct MainKernel : IComputeShader
@@ -54,11 +54,11 @@ namespace ComputeSharp.Sample
}
/// <summary>
/// Prints a matrix in a properly formatted way
/// Prints a matrix in a properly formatted way.
/// </summary>
/// <param name="array">The input <see langword="float"/> array representing the matrix to print</param>
/// <param name="width">The width of the array to print</param>
/// <param name="height">The height of the array to print</param>
/// <param name="array">The input <see langword="float"/> array representing the matrix to print.</param>
/// <param name="width">The width of the array to print.</param>
/// <param name="height">The height of the array to print.</param>
private static void PrintMatrix(float[] array, int width, int height)
{
int length = width * height;