@@ -151,6 +151,7 @@ class PolybenchBenchmarkSuiteEntry(NamedTuple):
151
151
runner : Optional [PolybenchBenchmarkSuiteRunner ]
152
152
tags : Set [str ]
153
153
suppress_validation_warnings : bool
154
+ additional_polybench_args : List [str ]
154
155
155
156
def validate (self ) -> Optional [str ]:
156
157
"""Ensures this suite can run. Returns an error string otherwise."""
@@ -436,7 +437,11 @@ def createCommandLineArgs(self, benchmarks, bmSuiteArgs):
436
437
java_distributions = _get_java_distributions (resolved_benchmark )
437
438
vm_args = mx .get_runtime_jvm_args (names = java_distributions ) + self .vmArgs (bmSuiteArgs )
438
439
mx_truffle .enable_truffle_native_access (vm_args )
439
- polybench_args = ["--path=" + resolved_benchmark .absolute_path ] + self .runArgs (bmSuiteArgs )
440
+ polybench_args = (
441
+ ["--path=" + resolved_benchmark .absolute_path ]
442
+ + self .runArgs (bmSuiteArgs )
443
+ + resolved_benchmark .suite .additional_polybench_args
444
+ )
440
445
return vm_args + [PolybenchBenchmarkSuite .POLYBENCH_MAIN ] + polybench_args
441
446
442
447
def runAndReturnStdOut (self , benchmarks , bmSuiteArgs ):
@@ -707,6 +712,7 @@ def register_polybench_benchmark_suite(
707
712
runner : Optional [PolybenchBenchmarkSuiteRunner ] = None ,
708
713
tags : Optional [Set [str ]] = None ,
709
714
suppress_validation_warnings : bool = False ,
715
+ additional_polybench_args : Optional [List [str ]] = None ,
710
716
):
711
717
"""
712
718
Registers a suite of polybench benchmarks. A polybench suite declares a distribution of benchmark files and the
@@ -730,6 +736,8 @@ def register_polybench_benchmark_suite(
730
736
input format as the "mx polybench" command).
731
737
:param tags: The set of tags supported by the runner.
732
738
:param suppress_validation_warnings: Whether to suppress warning messages when the suite specification does not validate.
739
+ :param additional_polybench_args: An optional list of arguments to always pass to the benchmark launcher (e.g., to
740
+ specify a load path for benchmark sources).
733
741
"""
734
742
check_late_registration (f"Polybench benchmark suite { name } " )
735
743
if isinstance (benchmark_file_filter , str ):
@@ -750,6 +758,7 @@ def register_polybench_benchmark_suite(
750
758
runner = runner ,
751
759
tags = tags if tags is not None else set (),
752
760
suppress_validation_warnings = suppress_validation_warnings ,
761
+ additional_polybench_args = additional_polybench_args or [],
753
762
)
754
763
if name in _polybench_benchmark_suite_registry :
755
764
mx .abort (
0 commit comments