Removed unmanaged struct requirement from SPMD job wrappers and extension methods, allowing managed types. Updated all wrappers and extension methods to require only the interface constraint. Refactored SPMD test jobs to use safe ref-based Store overloads. Improved README and docs with clearer debug/mimalloc instructions and a better SPMD example. Cleaned up Program.cs by removing obsolete experimental code. Enhanced math precision in GGXMipGenerationBenchmark. Updated T4 template to generate new constraints and APIs.
31 lines
746 B
C#
31 lines
746 B
C#
using BenchmarkDotNet.Running;
|
|
using Misaki.HighPerformance.LowLevel.Buffer;
|
|
using Misaki.HighPerformance.LowLevel.Collections;
|
|
using Misaki.HighPerformance.LowLevel.Utilities;
|
|
using Misaki.HighPerformance.Test.Benchmark;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices;
|
|
|
|
//BenchmarkRunner.Run<GGXMipGenerationBenchmark>();
|
|
|
|
const int count = 16;
|
|
|
|
var bench = new GGXMipGenerationBenchmark();
|
|
bench.Setup();
|
|
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
bench.JobGGX();
|
|
}
|
|
|
|
var sw = System.Diagnostics.Stopwatch.StartNew();
|
|
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
bench.JobGGX();
|
|
}
|
|
|
|
sw.Stop();
|
|
var avgTime = sw.Elapsed.TotalMilliseconds / count;
|
|
Console.WriteLine($"GGX Mip Generation (Inline): {avgTime} ms");
|
|
bench.Cleanup(); |