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
impl Prog
Sourcepub fn load(self)
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();
Sourcepub fn with_compile_args(self, compile_args: &str) -> Self
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more