Lines Matching full:specs
46 def _GenerateRandomRasks(specs): argument
50 specs: A list of spec from which the flag set is created.
58 for spec in specs:
77 def _GenerateAllFlagsTasks(specs): argument
80 All the boolean flags in the specs will be enabled and all the numeric flag
84 specs: A list of spec from which the flag set is created.
92 for spec in specs:
108 def GenerateRandomGATasks(specs, num_tasks, num_trials): argument
112 specs: A list of spec from which the flag set is created.
126 [Flag(spec) for spec in specs if random.randint(0, 1)]
139 def _GenerateInitialFlags(specs, spec): argument
145 For example, if the specs are [-finline-limit=[1-1000], -fstrict-aliasing] and
151 specs: an array of specifications from which the result flag_set is created.
158 An array of flags, each of which contains one spec in specs. All the values
159 of the flags are the largest values in specs, expect the one that contains
164 for other_spec in specs:
166 # Found the spec in the array specs.
189 def _GenerateAllIterativeEliminationTasks(specs): argument
195 For example, if the specs are [-finline-limit=[1-1000], -fstrict-aliasing],
203 specs: an array of specifications from which the result flag_set is created.
214 for spec in specs:
229 for spec in specs:
230 results.add(Task(flags.FlagSet(_GenerateInitialFlags(specs, spec))))
235 def _ComputeCost(cost_func, specs, flag_set): argument
238 All the boolean flags in the specs will be enabled and all the numeric flag
244 specs: All the specs that are used in the algorithm. This is used to check
254 for spec in specs:
280 def _TestAlgorithm(cost_func, specs, generations, best_result): argument
288 specs: All the specs that are used in the algorithm. This is used to check
318 task_result = _ComputeCost(cost_func, specs, task.GetFlags())
360 # Generate the testing specs.
361 specs = self._GenerateFlagSpecifications()
365 generation_tasks = _GenerateAllFlagsTasks(specs)
366 generations = [HillClimbingBestBranch(generation_tasks, set([]), specs)]
371 _TestAlgorithm("sum(values[0:len(values)])", specs, generations, 0)
378 cost = _ComputeCost(cost_function, specs, all_flags)
382 generations = [HillClimbingBestBranch(generation_tasks, set([]), specs)]
387 _TestAlgorithm(cost_function, specs, generations, cost)
398 # Generate the testing specs.
399 specs = self._GenerateFlagSpecifications()
402 STOP_THRESHOLD, NUM_CHROMOSOMES, NUM_TRIALS, specs, MUTATION_RATE
407 specs, NUM_CHROMOSOMES, NUM_TRIALS
412 _TestAlgorithm("sum(values[0:len(values)])", specs, generations, -1)
414 _TestAlgorithm(cost_func, specs, generations, -1)
425 # Generate the testing specs.
426 specs = self._GenerateFlagSpecifications()
431 generations = _GenerateAllIterativeEliminationTasks(specs)
436 _TestAlgorithm("sum(values[0:len(values)])", specs, generations, 0)
441 all_flags_tasks = _GenerateAllFlagsTasks(specs)
445 cost = _ComputeCost(cost_function, specs, all_flags)
452 _TestAlgorithm(cost_function, specs, generations, cost)