virtual public void BenchmarkStart(int index, int time, BenchmarkComplete oncomplete, object tag) { OnBenchmarkComplete = oncomplete; if (index >= SupportedAlgorithms.Length) { OnBenchmarkComplete(false, "Unknown algorithm", tag); return; } if (EnabledDeviceCount() == 0) { Helpers.ConsolePrint("BENCHMARK", "No device to benchmark.."); OnBenchmarkComplete(false, "Disabled", tag); return; // ignore, disabled device } BenchmarkTag = tag; BenchmarkIndex = index; CurrentAlgo = index; BenchmarkTime = time; string CommandLine = BenchmarkCreateCommandLine(index, time); Thread BenchmarkThread = new Thread(BenchmarkThreadRoutine); BenchmarkThread.Start(CommandLine); }
private void BenchmarkCompleted(bool success, string text, object tag) { if (this.InvokeRequired) { UpdateProgressBar(true); BenchmarkComplete d = new BenchmarkComplete(BenchmarkCompleted); this.Invoke(d, new object[] { success, text, tag }); } else { InitiateBenchmark(); } }
private void BenchmarkCompleted(string text, object tag) { if (this.InvokeRequired) { BenchmarkComplete d = new BenchmarkComplete(BenchmarkCompleted); this.Invoke(d, new object[] { text, tag }); } else { inBenchmark = false; CurrentlyBenchmarking = null; ListViewItem lvi = tag as ListViewItem; lvi.SubItems[2].Text = text; // initiate new benchmark InitiateBenchmark(); } }
private void BenchmarkCompleted(bool success, string text, object tag) { if (this.InvokeRequired) { BenchmarkComplete d = new BenchmarkComplete(BenchmarkCompleted); this.Invoke(d, new object[] { success, text, tag }); } else { inBenchmark = false; CurrentlyBenchmarking = null; ListViewItem lvi = tag as ListViewItem; lvi.SubItems[3].Text = text; // initiate new benchmark InitiateBenchmark(); } }
public virtual void BenchmarkStart(int index, int time, BenchmarkComplete oncomplete, object tag) { OnBenchmarkComplete = oncomplete; if (index >= SupportedAlgorithms.Length) { OnBenchmarkComplete(false, "Unknown algorithm", tag); return; } if (EnabledDeviceCount() == 0) { OnBenchmarkComplete(false, "Disabled", tag); return; // ignore, disabled device } BenchmarkTag = tag; BenchmarkIndex = index; string CommandLine = BenchmarkCreateCommandLine(index, time); Thread BenchmarkThread = new Thread(BenchmarkThreadRoutine); BenchmarkThread.Start(CommandLine); }
private void OnBenchmarkComplete(BenchmarkCompleteArgs e) => BenchmarkComplete?.Invoke(this, e);