Exemplo n.º 1
0
        public static int GetExpectedCount(ICompetitionConfig config, int methodsCount)
        {
            var runMode      = config.GetJobs().Single().Run;
            var unrollFactor = runMode.UnrollFactor;

            return(GetExpectedCountCore(config, methodsCount, unrollFactor));
        }
Exemplo n.º 2
0
        private List <IValidator> GetValidators(ICompetitionConfig competitionConfig)
        {
            var result = OverrideValidators(competitionConfig);

            bool debugMode = competitionConfig.AllowDebugBuilds;

            if (result.Any(v => v is JitOptimizationsValidator))
            {
                if (debugMode)
                {
                    result.RemoveAll(v => v is JitOptimizationsValidator && v.TreatsWarningsAsErrors);
                }
            }
            else if (competitionConfig.UpdateSourceAnnotations && !debugMode)
            {
                result.Insert(0, JitOptimizationsValidator.FailOnError);
            }

            if (competitionConfig.GetJobs().Any(j => j.Toolchain is InProcessToolchain) &&
                !result.Any(v => v is InProcessValidator))
            {
                result.Insert(0, debugMode ? InProcessValidator.DontFailOnError : InProcessValidator.FailOnError);
            }

            // DONTTOUCH: the RunStateSlots should be first in the chain.
            result.Insert(0, new RunStateSlots());

            return(result);
        }
Exemplo n.º 3
0
        public static int GetExpectedCount(ICompetitionConfig config, int methodsCount)
        {
            const int JittingCount = 1;
            var       runMode      = config.GetJobs().Single().Run;

            var sigleLaunchCount = JittingCount * runMode.UnrollFactor +
                                   (runMode.WarmupCount + runMode.TargetCount) * runMode.InvocationCount;

            return(sigleLaunchCount * runMode.LaunchCount * methodsCount);
        }
Exemplo n.º 4
0
 /// <summary>Override competition jobs.</summary>
 /// <param name="competitionConfig">The competition config.</param>
 /// <returns>The jobs for the competition</returns>
 protected virtual List <IJob> OverrideJobs([NotNull] ICompetitionConfig competitionConfig) =>
 competitionConfig.GetJobs().ToList();