Skip to content

Commit 3c293a1

Browse files
committed
If the optimizer has a constraint_aware attribute, set it in the strategy options
1 parent 7d93855 commit 3c293a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel_tuner/interface.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,9 @@ def tune_kernel_T1(
906906
adjusted_strategy_options = {k:v for k, v in strategy_options.items() if k not in filter_keys}
907907
optimizer_instance = optimizer_class(**adjusted_strategy_options)
908908
strategy = OptAlgWrapper(optimizer_instance)
909+
if "constraint_aware" not in strategy_options and hasattr(optimizer_instance, "constraint_aware"):
910+
# if the optimizer has a constraint_aware attribute, set it in the strategy options
911+
strategy_options["constraint_aware"] = optimizer_instance.constraint_aware
909912

910913
# set the cache path
911914
if cache_filepath is None and "SimulationInput" in kernelspec:

0 commit comments

Comments
 (0)