pub struct KernelModule { /* private fields */ }Expand description
A loaded CUDA kernel module with cached function handles.
Wraps cudarc’s CudaModule to provide a clean interface for loading PTX source (compiled at build time by build.rs) and launching kernels.
Implementations§
Source§impl KernelModule
impl KernelModule
Sourcepub fn from_ptx_src(ctx: &Arc<CudaContext>, ptx_src: &str) -> Result<Self>
pub fn from_ptx_src(ctx: &Arc<CudaContext>, ptx_src: &str) -> Result<Self>
Load a PTX module from source string into the given CUDA context.
The PTX source should be compiled at build time via nvcc –ptx and embedded with include_str!.
Sourcepub fn get_function(&self, name: &str) -> Result<CudaFunction>
pub fn get_function(&self, name: &str) -> Result<CudaFunction>
Get a kernel function handle by name.
Auto Trait Implementations§
impl Freeze for KernelModule
impl RefUnwindSafe for KernelModule
impl Send for KernelModule
impl Sync for KernelModule
impl Unpin for KernelModule
impl UnwindSafe for KernelModule
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