Struct ispc::Config

source ·
pub struct Config { /* private fields */ }
Expand description

Extra configuration to be passed to ISPC

Implementations§

source§

impl Config

source

pub fn new() -> Config

source

pub fn file<P>(&mut self, file: P) -> &mut Config
where P: AsRef<Path>,

Add an ISPC file to be compiled

source

pub fn out_dir<P>(&mut self, dir: P) -> &mut Config
where P: AsRef<Path>,

Set the output directory to override the default of env!("OUT_DIR")

source

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"

source

pub fn opt_level(&mut self, opt_level: u32) -> &mut Config

Set the optimization level to override the default of env!("OPT_LEVEL")

source

pub fn target(&mut self, target: &str) -> &mut Config

Set the target triple to compile for, overriding the default of env!("TARGET")

source

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.

source

pub fn addressing(&mut self, addressing: Addressing) -> &mut Config

Select the 32 or 64 bit addressing calculations for addressing calculations in ISPC.

source

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.

source

pub fn optimization_opt(&mut self, opt: OptimizationOpt) -> &mut Config

Set an optimization option.

source

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.

source

pub fn force_alignment(&mut self, alignment: u32) -> &mut Config

Force ISPC memory allocations to be aligned to alignment.

source

pub fn include_path<P>(&mut self, path: P) -> &mut Config
where P: AsRef<Path>,

Add an extra include path for the ispc compiler to search for files.

source

pub fn no_omit_frame_pointer(&mut self) -> &mut Config

Disable frame pointer omission. It may be useful for profiling to disable omission.

source

pub fn no_stdlib(&mut self) -> &mut Config

Don’t make the ispc standard library available.

source

pub fn no_cpp(&mut self) -> &mut Config

Don’t run the C preprocessor

source

pub fn quiet(&mut self) -> &mut Config

Enable suppression of all ispc compiler output.

source

pub fn werror(&mut self) -> &mut Config

Enable treating warnings as errors.

source

pub fn woff(&mut self) -> &mut Config

Disable all warnings.

source

pub fn wno_perf(&mut self) -> &mut Config

Don’t issue warnings related to performance issues

source

pub fn instrument(&mut self) -> &mut Config

Emit instrumentation code for ISPC to gather performance data such as vector utilization.

source

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.

source

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)

source

pub fn target_arch(&mut self, arch: Architecture) -> &mut Config

Select the CPU architecture to target

source

pub fn target_os(&mut self, os: TargetOS) -> &mut Config

Select the target OS for cross compilation

source

pub fn cargo_metadata(&mut self, metadata: bool) -> &mut Config

Set whether Cargo metadata should be emitted to link to the compiled library

source

pub fn bindgen_builder(&mut self, builder: Builder) -> &mut Config

source

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

source

pub fn ispc_version(&self) -> &Version

Get the ISPC compiler version.

Trait Implementations§

source§

impl Default for Config

source§

fn default() -> Config

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Config

§

impl !Send for Config

§

impl !Sync for Config

§

impl Unpin for Config

§

impl !UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.