pub struct GpuContext { /* private fields */ }Expand description
GPU acceleration context
Implementations§
Source§impl GpuContext
impl GpuContext
Sourcepub fn is_gpu_available(&self) -> bool
pub fn is_gpu_available(&self) -> bool
Check if GPU is available
Sourcepub fn device_info(&self) -> &GpuDeviceInfo
pub fn device_info(&self) -> &GpuDeviceInfo
Get device information
Sourcepub fn allocate_memory(&mut self, size_bytes: usize) -> Result<usize>
pub fn allocate_memory(&mut self, size_bytes: usize) -> Result<usize>
Allocate GPU memory
Sourcepub fn free_memory(&mut self, ptr: usize) -> Result<()>
pub fn free_memory(&mut self, ptr: usize) -> Result<()>
Free GPU memory
Sourcepub fn start_profiling(&mut self)
pub fn start_profiling(&mut self)
Start profiling
Sourcepub fn stop_profiling(&mut self) -> Option<ProfilingResults>
pub fn stop_profiling(&mut self) -> Option<ProfilingResults>
Stop profiling and get results
Auto Trait Implementations§
impl Freeze for GpuContext
impl RefUnwindSafe for GpuContext
impl Send for GpuContext
impl Sync for GpuContext
impl Unpin for GpuContext
impl UnwindSafe for GpuContext
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