pub struct OptimizedWebGPUBackend { /* private fields */ }
Expand description
High-performance WebGPU backend
Implementations§
Source§impl OptimizedWebGPUBackend
impl OptimizedWebGPUBackend
Sourcepub async fn with_config(config: WebGPUConfig) -> Result<Self>
pub async fn with_config(config: WebGPUConfig) -> Result<Self>
Create backend with custom configuration
Sourcepub fn compile_kernel(
&self,
shader_source: &str,
entry_point: &str,
) -> Result<String>
pub fn compile_kernel( &self, shader_source: &str, entry_point: &str, ) -> Result<String>
Compile and cache a kernel with optimization
Sourcepub async fn execute_kernel(
&self,
cache_key: &str,
buffers: &[&Buffer],
workgroup_count: [u32; 3],
) -> Result<f64>
pub async fn execute_kernel( &self, cache_key: &str, buffers: &[&Buffer], workgroup_count: [u32; 3], ) -> Result<f64>
Execute a cached kernel with optimal configuration
Sourcepub fn create_buffer(&self, size: u64, usage: BufferUsages) -> Result<Buffer>
pub fn create_buffer(&self, size: u64, usage: BufferUsages) -> Result<Buffer>
Create an optimized buffer with pooling
Sourcepub fn return_buffer(&self, buffer: Buffer)
pub fn return_buffer(&self, buffer: Buffer)
Return buffer to cache for reuse
Sourcepub fn get_stats(&self) -> BackendStats
pub fn get_stats(&self) -> BackendStats
Get comprehensive performance statistics
Sourcepub fn cache_hit_ratio(&self) -> f64
pub fn cache_hit_ratio(&self) -> f64
Get cache hit ratio
Sourcepub fn clear_caches(&self)
pub fn clear_caches(&self)
Clear all caches and reset statistics
Sourcepub fn performance_report(&self) -> String
pub fn performance_report(&self) -> String
Generate performance report
Auto Trait Implementations§
impl Freeze for OptimizedWebGPUBackend
impl !RefUnwindSafe for OptimizedWebGPUBackend
impl Send for OptimizedWebGPUBackend
impl Sync for OptimizedWebGPUBackend
impl Unpin for OptimizedWebGPUBackend
impl !UnwindSafe for OptimizedWebGPUBackend
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