pub struct GpuKernel { /* private fields */ }Expand description
GPU-accelerated kernel function wrapper
Implementations§
Source§impl GpuKernel
impl GpuKernel
Sourcepub fn new(kernel_type: KernelType, use_gpu: bool) -> Self
pub fn new(kernel_type: KernelType, use_gpu: bool) -> Self
Create a new GPU-accelerated kernel
pub async fn init_gpu(&mut self) -> GpuKernelResult<()>
Sourcepub async fn compute_matrix(
&self,
x: &Array2<f32>,
y: &Array2<f32>,
) -> Array2<f32>
pub async fn compute_matrix( &self, x: &Array2<f32>, y: &Array2<f32>, ) -> Array2<f32>
Compute kernel matrix with GPU acceleration if available
Sourcepub fn compute_cpu_kernel_matrix(
&self,
x: &Array2<f32>,
y: &Array2<f32>,
) -> Array2<f32>
pub fn compute_cpu_kernel_matrix( &self, x: &Array2<f32>, y: &Array2<f32>, ) -> Array2<f32>
Compute kernel matrix on CPU
Sourcepub fn is_gpu_available(&self) -> bool
pub fn is_gpu_available(&self) -> bool
Check if GPU is available and initialized
Sourcepub fn device_info(&self) -> String
pub fn device_info(&self) -> String
Get device information
Auto Trait Implementations§
impl Freeze for GpuKernel
impl RefUnwindSafe for GpuKernel
impl Send for GpuKernel
impl Sync for GpuKernel
impl Unpin for GpuKernel
impl UnsafeUnpin for GpuKernel
impl UnwindSafe for GpuKernel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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