Build

Struct Build 

Source
pub struct Build<'a> {
    pub halide_path: PathBuf,
    pub src: Vec<PathBuf>,
    pub output: PathBuf,
    pub cxx: Option<&'a str>,
    pub cxxflags: Option<&'a str>,
    pub ldflags: Option<&'a str>,
    pub build_args: Vec<&'a str>,
    pub run_args: Vec<&'a str>,
    pub keep: bool,
    pub generator: bool,
}
Expand description

Build stores the required context for building a Halide kernel

Fields§

§halide_path: PathBuf

Path to halide source

§src: Vec<PathBuf>

Input files

§output: PathBuf

Output file

§cxx: Option<&'a str>

C++ compiler

§cxxflags: Option<&'a str>

C++ compile time flags

§ldflags: Option<&'a str>

C++ link time flags

§build_args: Vec<&'a str>

Extra arguments to build step

§run_args: Vec<&'a str>

Extra arguments to run step

§keep: bool

Keep executable when finished running

§generator: bool

Include Halide generator header

Implementations§

Source§

impl<'a> Build<'a>

Source

pub fn new<P: AsRef<Path>, Q: AsRef<Path>>( halide_path: P, output: Q, ) -> Build<'a>

Create a new build with the given halide path and output

Source

pub fn source_file(self, src: impl AsRef<Path>) -> Self

Source

pub fn build_arg(self, src: &'a str) -> Self

Source

pub fn build_args(self, src: impl AsRef<[&'a str]>) -> Self

Source

pub fn run_arg(self, src: &'a str) -> Self

Source

pub fn run_args(self, src: impl AsRef<[&'a str]>) -> Self

Source

pub fn ldflags(self, flags: &'a str) -> Self

Source

pub fn cxxflags(self, flags: &'a str) -> Self

Source

pub fn compiler(self, name: &'a str) -> Self

Source

pub fn keep(self, x: bool) -> Self

Source

pub fn generator(self, x: bool) -> Self

Source

pub fn build(&self) -> Result<bool>

Execute the build step

Source

pub fn run(&self) -> Result<bool>

Execute the run step

Trait Implementations§

Source§

impl<'a> Debug for Build<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Build<'a>

§

impl<'a> RefUnwindSafe for Build<'a>

§

impl<'a> Send for Build<'a>

§

impl<'a> Sync for Build<'a>

§

impl<'a> Unpin for Build<'a>

§

impl<'a> UnwindSafe for Build<'a>

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>,

Source§

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>,

Source§

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.