Skip to main content

CodeGen

Struct CodeGen 

Source
pub struct CodeGen<'ctx> { /* private fields */ }

Implementations§

Source§

impl<'ctx> CodeGen<'ctx>

Source

pub fn new( model: &DiscreteModel<'_>, context: &'ctx Context, diffsl_real_type: RealType, real_type: FloatType<'ctx>, int_type: IntType<'ctx>, threaded: bool, ptr_size_bits: u64, real_size_bits: u64, int_size_bits: u64, debug: bool, constants_use_jit: bool, ) -> Result<Self>

Source

pub fn write_bitcode_to_path(&self, path: &Path)

Source

pub fn compile_set_u0<'m>( &mut self, model: &'m DiscreteModel<'_>, code: Option<&str>, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_calc_out<'m>( &mut self, model: &'m DiscreteModel<'_>, include_constants: bool, code: Option<&str>, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_calc_stop<'m>( &mut self, model: &'m DiscreteModel<'_>, include_constants: bool, code: Option<&str>, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_reset<'m>( &mut self, model: &'m DiscreteModel<'_>, include_constants: bool, code: Option<&str>, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_rhs<'m>( &mut self, model: &'m DiscreteModel<'_>, include_constants: bool, code: Option<&str>, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_mass<'m>( &mut self, model: &'m DiscreteModel<'_>, code: Option<&str>, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_gradient( &mut self, original_function: FunctionValue<'ctx>, args_type: &[CompileGradientArgType], mode: CompileMode, fn_name: &str, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_get_dims( &mut self, model: &DiscreteModel<'_>, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_get_tensor( &mut self, model: &DiscreteModel<'_>, name: &str, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_get_constant( &mut self, model: &DiscreteModel<'_>, name: &str, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_inputs( &mut self, model: &DiscreteModel<'_>, is_get: bool, ) -> Result<FunctionValue<'ctx>>

Source

pub fn compile_set_id( &mut self, model: &DiscreteModel<'_>, ) -> Result<FunctionValue<'ctx>>

Source

pub fn module(&self) -> &Module<'ctx>

Auto Trait Implementations§

§

impl<'ctx> !Freeze for CodeGen<'ctx>

§

impl<'ctx> !RefUnwindSafe for CodeGen<'ctx>

§

impl<'ctx> !Send for CodeGen<'ctx>

§

impl<'ctx> !Sync for CodeGen<'ctx>

§

impl<'ctx> Unpin for CodeGen<'ctx>

§

impl<'ctx> UnsafeUnpin for CodeGen<'ctx>

§

impl<'ctx> UnwindSafe for CodeGen<'ctx>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.