示例#1
0
        public static void Main(string[] args)
        {
            Utilities.RunBenchmark.Run(args, 2, (input) =>
            {
                var size         = input.sizes[0];
                var iterations   = input.sizes[1];
                var image_output = RunBenchmark.ParseBoolOption(input.cmd_opts, "images");

                if (input.type == typeof(double))
                {
                    var data = ReactionDiffusionSolverDouble.Create(size);
                    using (new DispTimer(string.Format("ReactionDiffusion (Double) {0}*{1}", size, iterations)))
                    {
                        ReactionDiffusionSolverDouble.Solve(data, iterations, image_output);
                        ReactionDiffusionSolverDouble.Sync(data);
                    }
                }
                else
                {
                    var data = ReactionDiffusionSolverSingle.Create(size);
                    using (new DispTimer(string.Format("ReactionDiffusion (Single) {0}*{1}", size, iterations)))
                    {
                        ReactionDiffusionSolverSingle.Solve(data, iterations, image_output);
                        ReactionDiffusionSolverSingle.Sync(data);
                    }
                }
            }
                                       );
        }
示例#2
0
        public static void Main(string[] args)
        {
            Utilities.RunBenchmark.Run(args, 3, (input) =>
            {
                var planets      = input.sizes[0];
                var asteroids    = input.sizes[1];
                var iterations   = input.sizes[2];
                var image_output = RunBenchmark.ParseBoolOption(input.cmd_opts, "images");

                if (input.type == typeof(double))
                {
                    var data = NiceSolverDouble.Create(planets, asteroids);
                    if (input.use_bohrium)
                    {
                        NumCIL.Bohrium.Utility.Flush();
                    }
                    using (new DispTimer(string.Format("Nice (Double) {0}x{1}*{2}", planets, asteroids, iterations)))
                    {
                        NiceSolverDouble.Solve(data, iterations, image_output);
                        //NiceSolverDouble.Sync(data);
                        if (input.use_bohrium)
                        {
                            NumCIL.Bohrium.Utility.Flush();
                        }
                    }
                }
                else
                {
                    var data = NiceSolverSingle.Create(planets, asteroids);
                    if (input.use_bohrium)
                    {
                        NumCIL.Bohrium.Utility.Flush();
                    }
                    using (new DispTimer(string.Format("Nice (Single) {0}x{1}*{2}", planets, asteroids, iterations)))
                    {
                        NiceSolverSingle.Solve(data, iterations, image_output);
                        //NiceSolverSingle.Sync(data);
                        if (input.use_bohrium)
                        {
                            NumCIL.Bohrium.Utility.Flush();
                        }
                    }
                }
            }
                                       );
        }