Пример #1
0
        public static void benchSOR()
        {
            int N = Constants.SOR_SIZE;

            SciMark2.Random R          = new SciMark2.Random(Constants.RANDOM_SEED);
            int             Iterations = 20000;

            double[][] G = RandomMatrix(N, N, R);

            foreach (var iteration in Benchmark.Iterations)
            {
                using (iteration.StartMeasurement())
                {
                    SOR.execute(1.25, G, Iterations);
                }
            }
        }
Пример #2
0
        public static double measureSOR(int N, double min_time, Random R)
        {
            double[][] G      = RandomMatrix(N, N, R);
            Stopwatch  Q      = new Stopwatch();
            int        cycles = 1;

            while (true)
            {
                Q.start();
                SOR.execute(1.25, G, cycles);
                Q.stop();
                if (Q.read() >= min_time)
                {
                    break;
                }

                cycles *= 2;
            }

            // approx Mflops
            return(SOR.num_flops(N, N, cycles) / Q.read() * 1.0e-6);
        }
Пример #3
0
        public static double measureSOR(int N, double min_time, Random R)
        {
            double[][] G = RandomMatrix(N, N, R);

            Stopwatch clock  = new Stopwatch();
            int       cycles = 1;

            while (true)
            {
                clock.Start();
                SOR.execute(1.25, G, cycles);
                clock.Stop();
                if (clock.Elapsed.TotalSeconds >= min_time)
                {
                    break;
                }

                cycles *= 2;
            }
            // approx Mflops
            return(SOR.num_flops(N, N, cycles) / clock.Elapsed.TotalMilliseconds * 1.0e-3);
        }
Пример #4
0
        public void benchSOR()
        {
            int Iterations = 20000;

            SOR.execute(1.25, inputSOR, Iterations);
        }