Removed BenchmarkDotNet, switched to manual

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-17 16:31:07 +02:00
1 親 0caff1f479
コミット df032526f3
3ファイル変更
+38 -8

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

+25 -1
ファイルの表示
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
namespace ComputeSharp.Benchmark
{
@@ -6,7 +7,30 @@ namespace ComputeSharp.Benchmark
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
var benchmark = new FullyConnectedLayerBenchmark();
benchmark.Gpu(); // Warmup
return;
Stopwatch timer = new Stopwatch();
TimeSpan cpuTime = TimeSpan.Zero, gpuTime = TimeSpan.Zero;
for (int i = 0; i < 10; i++)
{
benchmark.Cpu();
cpuTime += timer.Elapsed;
Console.WriteLine($"CPU: {timer.Elapsed:g}");
timer.Restart();
benchmark.Gpu();
gpuTime += timer.Elapsed;
Console.WriteLine($"GPU: {timer.Elapsed:g}");
timer.Restart();
}
Console.WriteLine("======== AVERAGE ========");
Console.WriteLine($"CPU: {cpuTime:g}");
Console.WriteLine($"GPU: {gpuTime:g}");
Console.ReadKey();
}
}
}