mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 19:44:57 -05:00
enhance(python-bindings): Expose the option to set or not the v0 strategy of the optimizer.
This commit is contained in:
@@ -62,8 +62,11 @@ void mlir::concretelang::python::populateCompilerAPISubmodule(
|
||||
.def("set_display_optimizer_choice",
|
||||
[](CompilationOptions &options, bool display) {
|
||||
options.optimizerConfig.display = display;
|
||||
})
|
||||
.def("set_strategy_v0",
|
||||
[](CompilationOptions &options, bool strategy_v0) {
|
||||
options.optimizerConfig.strategy_v0 = strategy_v0;
|
||||
});
|
||||
;
|
||||
|
||||
pybind11::class_<mlir::concretelang::JitCompilationResult>(
|
||||
m, "JITCompilationResult");
|
||||
|
||||
@@ -164,3 +164,16 @@ class CompilationOptions(WrapperCpp):
|
||||
if not isinstance(display, bool):
|
||||
raise TypeError("display should be a bool")
|
||||
self.cpp().set_display_optimizer_choice(display)
|
||||
|
||||
def set_strategy_v0(self, enable: bool):
|
||||
"""Set the strategy of the optimizer to the v0 one.
|
||||
|
||||
Args:
|
||||
enable (bool): if true the compiler use the V0 optimizer strategy.
|
||||
|
||||
Raises:
|
||||
TypeError: if the value is not a bool
|
||||
"""
|
||||
if not isinstance(enable, bool):
|
||||
raise TypeError("enable should be a bool")
|
||||
self.cpp().set_strategy_v0(enable)
|
||||
|
||||
Reference in New Issue
Block a user