pub struct WebGPUBackend { /* private fields */ }Expand description
WebGPU backend using wgpu for cross-platform GPU compute.
Implementations§
Source§impl WebGPUBackend
impl WebGPUBackend
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Check if WebGPU is conceptually available on this platform.
Actual adapter availability is verified in [initialize].
Trait Implementations§
Source§impl BackendTrait for WebGPUBackend
impl BackendTrait for WebGPUBackend
Source§fn capabilities(&self) -> &BackendCapabilities
fn capabilities(&self) -> &BackendCapabilities
Get backend capabilities
Source§fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the backend
Source§fn compile_kernel<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn compile_kernel<'life0, 'life1, 'async_trait>(
&'life0 self,
source: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Compile a kernel
Source§fn launch_kernel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
kernel: &'life1 [u8],
grid: (u32, u32, u32),
_block: (u32, u32, u32),
args: &'life2 [*const u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn launch_kernel<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
kernel: &'life1 [u8],
grid: (u32, u32, u32),
_block: (u32, u32, u32),
args: &'life2 [*const u8],
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Launch a kernel
Source§fn copy_memory(
&self,
dst: *mut u8,
src: *const u8,
size: usize,
kind: MemcpyKind,
) -> Result<()>
fn copy_memory( &self, dst: *mut u8, src: *const u8, size: usize, kind: MemcpyKind, ) -> Result<()>
Copy memory
Source§fn synchronize(&self) -> Result<()>
fn synchronize(&self) -> Result<()>
Synchronize device
Source§impl Default for WebGPUBackend
impl Default for WebGPUBackend
impl Send for WebGPUBackend
impl Sync for WebGPUBackend
Auto Trait Implementations§
impl !Freeze for WebGPUBackend
impl !RefUnwindSafe for WebGPUBackend
impl !UnwindSafe for WebGPUBackend
impl Unpin for WebGPUBackend
impl UnsafeUnpin for WebGPUBackend
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