Пример #1
0
        public static double measureMonteCarlo(double min_time, Random R)
        {
            Stopwatch stopwatch   = new Stopwatch();
            int       Num_samples = 40000000;

            stopwatch.start();
            MonteCarlo.integrate(Num_samples);
            stopwatch.stop();
            return(MonteCarlo.num_flops(Num_samples) / stopwatch.read() * 1E-06);
        }
Пример #2
0
        public static void benchMonteCarlo()
        {
            SciMark2.Random R          = new SciMark2.Random(Constants.RANDOM_SEED);
            int             Iterations = 40000000;

            foreach (var iteration in Benchmark.Iterations)
            {
                using (iteration.StartMeasurement())
                {
                    MonteCarlo.integrate(Iterations);
                }
            }
        }
Пример #3
0
        public static double measureMonteCarlo(double min_time, Random R)
        {
            Stopwatch clock = new Stopwatch();

            int cycles = 1;

            while (true)
            {
                clock.Start();
                MonteCarlo.integrate(cycles);
                clock.Stop();
                if (clock.Elapsed.TotalSeconds >= min_time)
                {
                    break;
                }

                cycles *= 2;
            }
            // approx Mflops
            return(MonteCarlo.num_flops(cycles) / clock.Elapsed.TotalMilliseconds * 1.0e-3);
        }
Пример #4
0
        public static double measureMonteCarlo(double min_time, Random R)
        {
            Stopwatch Q = new Stopwatch();

            int cycles = 1;

            while (true)
            {
                Q.start();
                MonteCarlo.integrate(cycles);
                Q.stop();
                if (Q.read() >= min_time)
                {
                    break;
                }

                cycles *= 2;
            }

            // approx Mflops
            return(MonteCarlo.num_flops(cycles) / Q.read() * 1.0e-6);
        }
Пример #5
0
        public void benchMonteCarlo()
        {
            int Iterations = 40000000;

            MonteCarlo.integrate(Iterations);
        }