Struct ispc_compile::Config
source · pub struct Config { /* private fields */ }
Expand description
Extra configuration to be passed to ISPC
Implementations§
source§impl Config
impl Config
pub fn new() -> Config
sourcepub fn out_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Config
pub fn out_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Config
Set the output directory to override the default of env!("OUT_DIR")
sourcepub fn debug(&mut self, debug: bool) -> &mut Config
pub fn debug(&mut self, debug: bool) -> &mut Config
Set whether debug symbols should be generated, symbols are generated by
default if env!("DEBUG") == "true"
sourcepub fn opt_level(&mut self, opt_level: u32) -> &mut Config
pub fn opt_level(&mut self, opt_level: u32) -> &mut Config
Set the optimization level to override the default of env!("OPT_LEVEL")
sourcepub fn target(&mut self, target: &str) -> &mut Config
pub fn target(&mut self, target: &str) -> &mut Config
Set the target triple to compile for, overriding the default of env!("TARGET")
sourcepub fn add_define(&mut self, define: &str, value: Option<&str>) -> &mut Config
pub fn add_define(&mut self, define: &str, value: Option<&str>) -> &mut Config
Add a define to be passed to the ISPC compiler, e.g. -DFOO
or -DBAR=FOO
if a value should also be set.
sourcepub fn addressing(&mut self, addressing: Addressing) -> &mut Config
pub fn addressing(&mut self, addressing: Addressing) -> &mut Config
Select the 32 or 64 bit addressing calculations for addressing calculations in ISPC.
sourcepub fn math_lib(&mut self, math_lib: MathLib) -> &mut Config
pub fn math_lib(&mut self, math_lib: MathLib) -> &mut Config
Set the math library used by ISPC code, defaults to the ISPC math library.
sourcepub fn optimization_opt(&mut self, opt: OptimizationOpt) -> &mut Config
pub fn optimization_opt(&mut self, opt: OptimizationOpt) -> &mut Config
Set an optimization option.
sourcepub fn cpu(&mut self, cpu: CPU) -> &mut Config
pub fn cpu(&mut self, cpu: CPU) -> &mut Config
Set the cpu target. This overrides the default choice of ISPC which is to target the host CPU.
sourcepub fn force_alignment(&mut self, alignment: u32) -> &mut Config
pub fn force_alignment(&mut self, alignment: u32) -> &mut Config
Force ISPC memory allocations to be aligned to alignment
.
sourcepub fn include_path<P: AsRef<Path>>(&mut self, path: P) -> &mut Config
pub fn include_path<P: AsRef<Path>>(&mut self, path: P) -> &mut Config
Add an extra include path for the ispc compiler to search for files.
sourcepub fn no_omit_frame_pointer(&mut self) -> &mut Config
pub fn no_omit_frame_pointer(&mut self) -> &mut Config
Disable frame pointer omission. It may be useful for profiling to disable omission.
sourcepub fn instrument(&mut self) -> &mut Config
pub fn instrument(&mut self) -> &mut Config
Emit instrumentation code for ISPC to gather performance data such as vector utilization.
sourcepub fn target_isa(&mut self, target: TargetISA) -> &mut Config
pub fn target_isa(&mut self, target: TargetISA) -> &mut Config
Select the target ISA and vector width. If none is specified ispc will choose the host CPU ISA and vector width.
sourcepub fn target_isas(&mut self, targets: Vec<TargetISA>) -> &mut Config
pub fn target_isas(&mut self, targets: Vec<TargetISA>) -> &mut Config
Select multiple target ISAs and vector widths. If none is specified ispc will choose the host CPU ISA and vector width. Note that certain options are not compatible with this use case, e.g. AVX1.1 will replace AVX1, Host should not be passed (just use the default)
sourcepub fn target_arch(&mut self, arch: Architecture) -> &mut Config
pub fn target_arch(&mut self, arch: Architecture) -> &mut Config
Select the CPU architecture to target
sourcepub fn target_os(&mut self, os: TargetOS) -> &mut Config
pub fn target_os(&mut self, os: TargetOS) -> &mut Config
Select the target OS for cross compilation
sourcepub fn cargo_metadata(&mut self, metadata: bool) -> &mut Config
pub fn cargo_metadata(&mut self, metadata: bool) -> &mut Config
Set whether Cargo metadata should be emitted to link to the compiled library
pub fn bindgen_builder(&mut self, builder: Builder) -> &mut Self
sourcepub fn compile(&self, lib: &str)
pub fn compile(&self, lib: &str)
The library name should not have any prefix or suffix, e.g. instead of
libexample.a
or example.lib
simply pass example
sourcepub fn ispc_version(&self) -> &Version
pub fn ispc_version(&self) -> &Version
Get the ISPC compiler version.