示例#1
0
        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();
     }
 }
示例#3
0
        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();
            }
        }
示例#4
0
        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();
            }
        }
示例#5
0
        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);