Exemple #1
0
 public static void main(string[] args)
 {
     if (args.Length == 0)
     {
         Console.WriteLine("Benchmark options:");
         Console.WriteLine("  -regen                        Regenerate reference images for a variety of sizes");
         Console.WriteLine("  -bench [threads] [resolution] Run a single iteration of the benchmark using the specified thread count and image resolution");
         Console.WriteLine("                                Default: threads=0 (auto-detect cpus), resolution=256");
     }
     else if (args[0] == "-regen")
     {
         int[] sizes = { 32, 64, 96, 128, 256, 384, 512 };
         foreach (int s in sizes)
         {
             // run a single iteration to generate the reference image
             Benchmark b = new Benchmark(s, true, false, true);
             b.kernelMain();
         }
     }
     else if (args[0] == "-bench")
     {
         int threads = 0, resolution = 256;
         if (args.Length > 1)
             threads = int.Parse(args[1]);
         if (args.Length > 2)
             resolution = int.Parse(args[2]);
         Benchmark benchmark = new Benchmark(resolution, false, true, false, threads);
         benchmark.kernelBegin();
         benchmark.kernelMain();
         benchmark.kernelEnd();
     }
 }
Exemple #2
0
 public BenchmarkScene(Benchmark benchmark)
 {
     this.benchmark = benchmark;
     build();
     render(SunflowAPI.DEFAULT_OPTIONS, saveOutput ? new FileDisplay(string.Format("resources/golden_{0}.png", resolution)) : benchmark);
     //fixme: add padding zeros
 }