예제 #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
파일: kernel.cs 프로젝트: wyrover/coreclr
        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);
        }