Sfoglia il codice sorgente

Add --kernel=adaptive-jit-favor-small-loops to tests

jonathanvdc 8 anni fa
parent
commit
18bf662d35
2 ha cambiato i file con 9 aggiunte e 4 eliminazioni
  1. 5 1
      performance/test_mvc_simulate_larger.py
  2. 4 3
      performance/utils.py

+ 5 - 1
performance/test_mvc_simulate_larger.py

@@ -335,4 +335,8 @@ class TestMvCSimulateLarger(unittest.TestCase):
 
 utils.define_perf_tests(
     TestMvCSimulateLarger,
-    TestMvCSimulateLarger.transform_add_MT_pn_simulate_larger)
+    TestMvCSimulateLarger.transform_add_MT_pn_simulate_larger,
+    optimization_levels=[
+        utils.OPTIMIZATION_LEVEL_ADAPTIVE_JIT_FAVOR_LOOPS,
+        utils.OPTIMIZATION_LEVEL_ADAPTIVE_JIT_FAVOR_SMALL_LOOPS
+    ])

+ 4 - 3
performance/utils.py

@@ -345,10 +345,11 @@ def define_perf_test(target_class, test_function, optimization_level):
         'test_%s' % optimization_level.replace('-', '_').lower(),
         lambda self: test_function(self, optimization_level))
 
-def define_perf_tests(target_class, test_function):
+def define_perf_tests(target_class, test_function, optimization_levels=None):
     """Defines performance tests in the given class. Each test calls the given function."""
-    for optimization_level in ALL_OPTIMIZATION_LEVELS:
-        define_perf_test(target_class, test_function, optimization_level)
+    optimization_levels = ALL_OPTIMIZATION_LEVELS
+    for opt_level in optimization_levels:
+        define_perf_test(target_class, test_function, opt_level)
 
 def get_model_constructor(code):
     # First change multiple spaces to a tab