Example #1
0
 /// <summary>
 /// Creates a new job based on the given job with additional environment variable.
 /// All existed environment variables of the original job will be copied to the new one.
 /// If the original job already contains an environment variable with the same key, it will be overriden.
 /// </summary>
 /// <param name="job">The original job</param>
 /// <param name="key">The key of the new environment variable</param>
 /// <param name="value">The value of the new environment variable</param>
 /// <returns>The new job with additional environment variable</returns>
 public static Job WithEnvironmentVariable(this Job job, [NotNull] string key, [NotNull] string value)
 => job.With(new EnvironmentVariable(key, value));
Example #2
0
 // Env
 public static Job With(this Job job, Platform platform) => job.With(job.Env.Platform.Mutate(platform));
Example #3
0
 public static Job WithEvaluateOverhead(this Job job, bool value) => job.With(job.Accuracy.EvaluateOverhead.Mutate(value));
Example #4
0
 public static Job WithAnaylyzeLaunchVariance(this Job job, bool value) => job.With(job.Accuracy.AnaylyzeLaunchVariance.Mutate(value));
Example #5
0
 public static Job With(this Job job, IEngine engine) => job.With(job.Infrastructure.Engine.Mutate(engine));
Example #6
0
 public static Job WithMinIterationTime(this Job job, TimeInterval value) => job.With(job.Accuracy.MinIterationTime.Mutate(value));
Example #7
0
 public static Job WithGcCpuGroups(this Job job, bool value) => job.With(job.Env.Gc.CpuGroups.Mutate(value));
Example #8
0
 // Infrastructure
 public static Job With(this Job job, IToolchain toolchain) => job.With(job.Infrastructure.Toolchain.Mutate(toolchain));
Example #9
0
 public static Job WithGcServer(this Job job, bool value) => job.With(job.Env.Gc.Server.Mutate(value));
Example #10
0
 public static Job WithGcConcurrent(this Job job, bool value) => job.With(job.Env.Gc.Concurrent.Mutate(value));
Example #11
0
 public static Job WithAffinity(this Job job, IntPtr affinity) => job.With(job.Env.Affinity.Mutate(affinity));
Example #12
0
 public static Job With(this Job job, Runtime runtime) => job.With(job.Env.Runtime.Mutate(runtime));
Example #13
0
 public static Job With(this Job job, Jit jit) => job.With(job.Env.Jit.Mutate(jit));
Example #14
0
 public static Job WithInvocationCount(this Job job, int count) => job.With(job.Run.InvocationCount.Mutate(count));
Example #15
0
 public static Job WithGcForce(this Job job, bool value) => job.With(job.Env.Gc.Force.Mutate(value));
Example #16
0
 public static Job WithUnrollFactor(this Job job, int factor) => job.With(job.Run.UnrollFactor.Mutate(factor));
Example #17
0
 public static Job WithGcAllowVeryLargeObjects(this Job job, bool value) => job.With(job.Env.Gc.AllowVeryLargeObjects.Mutate(value));
Example #18
0
 public static Job With(this Job job, IClock clock) => job.With(job.Infrastructure.Clock.Mutate(clock));
Example #19
0
 // Run
 public static Job With(this Job job, RunStrategy strategy) => job.With(job.Run.RunStrategy.Mutate(strategy));
Example #20
0
 // Accuracy
 public static Job WithMaxStdErrRelative(this Job job, double value) => job.With(job.Accuracy.MaxStdErrRelative.Mutate(value));
Example #21
0
 public static Job WithLaunchCount(this Job job, int count) => job.With(job.Run.LaunchCount.Mutate(count));
Example #22
0
 public static Job WithMinInvokeCount(this Job job, int value) => job.With(job.Accuracy.MinInvokeCount.Mutate(value));
Example #23
0
 public static Job WithWarmupCount(this Job job, int count) => job.With(job.Run.WarmupCount.Mutate(count));
Example #24
0
 public static Job WithRemoveOutliers(this Job job, bool value) => job.With(job.Accuracy.RemoveOutliers.Mutate(value));
Example #25
0
 public static Job WithTargetCount(this Job job, int count) => job.With(job.Run.TargetCount.Mutate(count));
        public static void Test03IdDoesNotFlow()
        {
            var j = new Job(EnvMode.LegacyJitX64, RunMode.Long); // id will not flow, new Job
            False(j.HasValue(JobMode.IdCharacteristic));
            False(j.Env.HasValue(JobMode.IdCharacteristic));

            Job.EnvCharacteristic[j] = EnvMode.LegacyJitX86.UnfreezeCopy(); // id will not flow
            False(j.HasValue(JobMode.IdCharacteristic));
            False(j.Env.HasValue(JobMode.IdCharacteristic));

            var c = new CharacteristicSet(EnvMode.LegacyJitX64, RunMode.Long); // id will not flow, new CharacteristicSet
            False(c.HasValue(JobMode.IdCharacteristic));

            Job.EnvCharacteristic[c] = EnvMode.LegacyJitX86.UnfreezeCopy(); // id will not flow
            False(c.HasValue(JobMode.IdCharacteristic));

            JobMode.IdCharacteristic[c] = "MyId"; // id set explicitly
            Equal(c.Id, "MyId");

            j = new Job("MyId", EnvMode.LegacyJitX64, RunMode.Long); // id set explicitly
            Equal(j.Id, "MyId");
            Equal(j.Env.Id, "MyId");

            Job.EnvCharacteristic[j] = EnvMode.LegacyJitX86.UnfreezeCopy(); // id will not flow
            Equal(j.Id, "MyId");
            Equal(j.Env.Id, "MyId");

            j = j.With(Jit.RyuJit);  // id will not flow
            False(j.HasValue(JobMode.IdCharacteristic));
        }
Example #27
0
 public static Job WithIterationTime(this Job job, TimeInterval time) => job.With(job.Run.IterationTime.Mutate(time));
Example #28
0
 /// <summary>
 /// Creates a new job based on the given job without any environment variables.
 /// </summary>
 /// <param name="job">The original job</param>
 /// <returns>The new job which doesn't have any environment variables</returns>
 public static Job WithoutEnvironmentVariables(this Job job) => job.With(Array.Empty <EnvironmentVariable>());
 public static Job With(this Job job, IEngineFactory engineFactory) => job.With(job.Infrastructure.EngineFactory.Mutate(engineFactory));