pub struct Module { /* private fields */ }
Expand description
Represents a compiled device kernel.
This struct wraps a FFI pointer to the C++ pxl::Module
class.
It provides methods for creating functions.
Implementations§
Source§impl Module
Implementation of the Module
struct.
impl Module
Implementation of the Module
struct.
Sourcepub fn get(&self) -> *mut Module
pub fn get(&self) -> *mut Module
Returns a raw pointer to the underlying FFI Module
object.
This is called in runtime wrapper APIs requiring a raw pointer.
§Safety
Caller must ensure that FFI object is valid.
Sourcepub fn create_function(&self, name: &str) -> Function
pub fn create_function(&self, name: &str) -> Function
Creates a new Function
object.
§Arguments
name
- Name of theFunction
to be created.
§Returns
A new Function
object.
§Safety
Caller must ensure that name
is valid and corresponds to an actual function in the module.
§Example
let module = pxl::create_module("tests/mu_kernel.mubin");
let function = module.create_function("sort_with_ptr");
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl !Send for Module
impl !Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
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