@@ -151,6 +151,7 @@ class PolybenchBenchmarkSuiteEntry(NamedTuple):
151151 runner : Optional [PolybenchBenchmarkSuiteRunner ]
152152 tags : Set [str ]
153153 suppress_validation_warnings : bool
154+ additional_polybench_args : List [str ]
154155
155156 def validate (self ) -> Optional [str ]:
156157 """Ensures this suite can run. Returns an error string otherwise."""
@@ -436,7 +437,11 @@ def createCommandLineArgs(self, benchmarks, bmSuiteArgs):
436437 java_distributions = _get_java_distributions (resolved_benchmark )
437438 vm_args = mx .get_runtime_jvm_args (names = java_distributions ) + self .vmArgs (bmSuiteArgs )
438439 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+ )
440445 return vm_args + [PolybenchBenchmarkSuite .POLYBENCH_MAIN ] + polybench_args
441446
442447 def runAndReturnStdOut (self , benchmarks , bmSuiteArgs ):
@@ -707,6 +712,7 @@ def register_polybench_benchmark_suite(
707712 runner : Optional [PolybenchBenchmarkSuiteRunner ] = None ,
708713 tags : Optional [Set [str ]] = None ,
709714 suppress_validation_warnings : bool = False ,
715+ additional_polybench_args : Optional [List [str ]] = None ,
710716):
711717 """
712718 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(
730736 input format as the "mx polybench" command).
731737 :param tags: The set of tags supported by the runner.
732738 :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).
733741 """
734742 check_late_registration (f"Polybench benchmark suite { name } " )
735743 if isinstance (benchmark_file_filter , str ):
@@ -750,6 +758,7 @@ def register_polybench_benchmark_suite(
750758 runner = runner ,
751759 tags = tags if tags is not None else set (),
752760 suppress_validation_warnings = suppress_validation_warnings ,
761+ additional_polybench_args = additional_polybench_args or [],
753762 )
754763 if name in _polybench_benchmark_suite_registry :
755764 mx .abort (
0 commit comments