pub enum UnifiedGpuBackend {
Cuda(CudaMemoryBackend),
Rocm(RocmMemoryBackend),
OneApi(OneApiMemoryBackend),
Metal(MetalMemoryBackend),
}Expand description
Unified backend wrapper
Variants§
Cuda(CudaMemoryBackend)
Rocm(RocmMemoryBackend)
OneApi(OneApiMemoryBackend)
Metal(MetalMemoryBackend)
Implementations§
Source§impl UnifiedGpuBackend
impl UnifiedGpuBackend
Sourcepub fn new(config: VendorConfig) -> Result<Self, UnifiedGpuError>
pub fn new(config: VendorConfig) -> Result<Self, UnifiedGpuError>
Create backend from configuration
Sourcepub fn auto_create() -> Result<Self, UnifiedGpuError>
pub fn auto_create() -> Result<Self, UnifiedGpuError>
Auto-detect and create best backend
Sourcepub fn get_vendor(&self) -> GpuVendor
pub fn get_vendor(&self) -> GpuVendor
Get vendor type
Sourcepub fn allocate(&mut self, size: usize) -> Result<*mut c_void, UnifiedGpuError>
pub fn allocate(&mut self, size: usize) -> Result<*mut c_void, UnifiedGpuError>
Allocate memory with unified interface
Sourcepub fn free(&mut self, ptr: *mut c_void) -> Result<(), UnifiedGpuError>
pub fn free(&mut self, ptr: *mut c_void) -> Result<(), UnifiedGpuError>
Free memory with unified interface
Sourcepub fn get_total_memory(&self) -> usize
pub fn get_total_memory(&self) -> usize
Get unified memory statistics Get total available GPU memory
pub fn get_memory_stats(&self) -> UnifiedMemoryStats
Auto Trait Implementations§
impl Freeze for UnifiedGpuBackend
impl RefUnwindSafe for UnifiedGpuBackend
impl Send for UnifiedGpuBackend
impl Sync for UnifiedGpuBackend
impl Unpin for UnifiedGpuBackend
impl UnsafeUnpin for UnifiedGpuBackend
impl UnwindSafe for UnifiedGpuBackend
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