pub struct KernelManager { /* private fields */ }Expand description
Kernel manager for compiling and executing GPU kernels
Implementations§
Source§impl KernelManager
impl KernelManager
Sourcepub fn new(
backend: GpuBackend,
options: CompilationOptions,
) -> Result<Self, KernelError>
pub fn new( backend: GpuBackend, options: CompilationOptions, ) -> Result<Self, KernelError>
Create a new kernel manager for the specified backend
Sourcepub fn generate_kernel_from_template(
&self,
template_name: &str,
parameters: &HashMap<String, String>,
) -> Result<String, KernelError>
pub fn generate_kernel_from_template( &self, template_name: &str, parameters: &HashMap<String, String>, ) -> Result<String, KernelError>
Generate kernel from template
Sourcepub fn compile_kernel(
&mut self,
name: String,
source: String,
) -> Result<Arc<CompiledKernel>, KernelError>
pub fn compile_kernel( &mut self, name: String, source: String, ) -> Result<Arc<CompiledKernel>, KernelError>
Compile and cache a kernel
Sourcepub fn get_kernel(&self, name: &str) -> Option<Arc<CompiledKernel>>
pub fn get_kernel(&self, name: &str) -> Option<Arc<CompiledKernel>>
Get cached kernel
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear kernel cache
Sourcepub fn get_capabilities(&self) -> CompilerCapabilities
pub fn get_capabilities(&self) -> CompilerCapabilities
Get compiler capabilities
Sourcepub fn calculate_launch_config(
&self,
kernel_type: KernelType,
data_size: usize,
) -> LaunchConfig
pub fn calculate_launch_config( &self, kernel_type: KernelType, data_size: usize, ) -> LaunchConfig
Calculate optimal launch configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KernelManager
impl !RefUnwindSafe for KernelManager
impl Send for KernelManager
impl Sync for KernelManager
impl Unpin for KernelManager
impl UnsafeUnpin for KernelManager
impl !UnwindSafe for KernelManager
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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