Struct wasmedge_sdk::config::CompilerConfigOptions
source · pub struct CompilerConfigOptions { /* private fields */ }Expand description
Defines a group of configuration options for AOT compiler.
CompilerConfigOptions is used to set the AOT compiler related configuration options, which are
-
Compiler Optimization Levels
-
O0performs as many optimizations as possible. -
O1optimizes quickly without destroying debuggability -
02optimizes for fast execution as much as possible without triggering significant incremental compile time or code size growth -
O3optimizes for fast execution as much as possible -
Osoptimizes for small code size as much as possible without triggering significant incremental compile time or execution time slowdowns -
Ozoptimizes for small code size as much as possible
-
-
Compiler Output Formats
Nativespecifies the output format is native dynamic library (*.wasm.so)Wasmspecifies the output format is WebAssembly with AOT compiled codes in custom section (*.wasm).
-
dump_irdetermines if AOT compiler generates IR or not -
generic_binarydetermines if AOT compiler generates the generic binary or not. -
interruptibledetermines if AOT compiler generates interruptible binary or not.
The configuration options above are only effective to AOT compiler.
Implementations§
source§impl CompilerConfigOptions
impl CompilerConfigOptions
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new instance of CompilerConfigOptions.
sourcepub fn out_format(self, format: CompilerOutputFormat) -> Self
pub fn out_format(self, format: CompilerOutputFormat) -> Self
Sets the output binary format of AOT compiler.
Argument
formatspecifies the format of the output binary.
sourcepub fn optimization_level(self, level: CompilerOptimizationLevel) -> Self
pub fn optimization_level(self, level: CompilerOptimizationLevel) -> Self
Sets the optimization level of AOT compiler.
Argument
levelspecifies the optimization level of AOT compiler.
sourcepub fn generic_binary(self, enable: bool) -> Self
pub fn generic_binary(self, enable: bool) -> Self
Sets the generic binary option of AOT compiler.
Argument
enablespecifies if generate the generic binary or not when perform AOT compilation.
sourcepub fn interruptible(self, enable: bool) -> Self
pub fn interruptible(self, enable: bool) -> Self
Enables or Disables the Interruptible option of AOT compiler.
This option determines to generate interruptible binary or not when compilation in AOT compiler.
Argument
enablespecifies if turn on theInterruptibleoption.
Trait Implementations§
source§impl Clone for CompilerConfigOptions
impl Clone for CompilerConfigOptions
source§fn clone(&self) -> CompilerConfigOptions
fn clone(&self) -> CompilerConfigOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more