Struct Prog

Source
pub struct Prog { /* private fields */ }
Expand description

An abstration for container with the computational kernels we want to execute.

A program must be one of PrgType types.

In some cases (e.g. PrgType::Src), the kernels contained in a program will be compiled at runtime, we provide the option to pass along additional compiler options.

Programs must be loaded into the MCL environment usingtheProg::load function, or created and loaded simultaneously via the Mcl::load_prog() api.

§Example

 use mcl_rs::{MclEnvBuilder,PrgType};

 let mcl = MclEnvBuilder::new().num_workers(10).initialize();

 mcl.create_prog("my_path",PrgType::Src)
     .with_compile_args("-D MYDEF")
     .load();

Implementations§

Source§

impl Prog

Source

pub fn load(self)

Loads the program into the current MCL environment

§Example
 use mcl_rs::{MclEnvBuilder,PrgType};

 let mcl = MclEnvBuilder::new().num_workers(10).initialize();
 let prog = mcl.create_prog("my_path",PrgType::Src);
 prog.load();

 // alternatively it is common to call 'load' directly on 'create_prog'
  mcl.create_prog("my_path2",PrgType::Src).load();
Source

pub fn with_compile_args(self, compile_args: &str) -> Self

Allows one to specifiy arguments to pass to the compiler when compiling the kernels within this program

§Example
 use mcl_rs::{MclEnvBuilder,PrgType};

 let mcl = MclEnvBuilder::new().num_workers(10).initialize();
 let prog = mcl.create_prog("my_path",PrgType::Src);
 prog.with_compile_args("-D MYDEF").load();

 // alternatively it is common to create/load a prog in one line
  mcl.create_prog("my_path2",PrgType::Src)
     .with_compile_args("-D MYDEF")
     .load();

Auto Trait Implementations§

§

impl Freeze for Prog

§

impl RefUnwindSafe for Prog

§

impl Send for Prog

§

impl Sync for Prog

§

impl Unpin for Prog

§

impl UnwindSafe for Prog

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.