Example #1
0
        public static double measureSOR(int N, double min_time, Random R)
        {
            double[][] G              = kernel.RandomMatrix(N, N, R);
            Stopwatch  stopwatch      = new Stopwatch();
            int        num_iterations = 40000;

            stopwatch.start();
            SOR.execute(1.25, G, num_iterations);
            stopwatch.stop();
            return(SOR.num_flops(N, N, num_iterations) / stopwatch.read() * 1E-06);
        }
Example #2
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);
                }
            }
        }
Example #3
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);
        }
Example #4
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);
        }
        public void benchSOR()
        {
            int Iterations = 20000;

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