pub struct WebGpuRuntime { /* private fields */ }Expand description
CubeCL WebGPU runtime wrapper.
§Examples
use tenferro_gpu::webgpu::WebGpuRuntime;
let _ctor: fn(usize) -> tenferro_tensor::Result<WebGpuRuntime> = WebGpuRuntime::new;
let _sync: fn(&WebGpuRuntime) -> tenferro_tensor::Result<()> =
WebGpuRuntime::synchronize;Implementations§
Source§impl WebGpuRuntime
impl WebGpuRuntime
Sourcepub fn new(device_ordinal: usize) -> Result<Self>
pub fn new(device_ordinal: usize) -> Result<Self>
Initialize the CubeCL WebGPU runtime for a discrete GPU ordinal.
§Examples
use tenferro_gpu::webgpu::WebGpuRuntime;
let _ctor: fn(usize) -> tenferro_tensor::Result<WebGpuRuntime> = WebGpuRuntime::new;§Errors
Returns crate::Error::RuntimeState when the requested adapter is
unavailable or CubeCL initialization panics while selecting it.
Sourcepub fn new_default() -> Result<Self>
pub fn new_default() -> Result<Self>
Initialize the CubeCL WebGPU runtime using CubeCL’s default adapter selection.
§Examples
use tenferro_gpu::webgpu::WebGpuRuntime;
let _ctor: fn() -> tenferro_tensor::Result<WebGpuRuntime> = WebGpuRuntime::new_default;§Errors
Returns crate::Error::RuntimeState when default adapter selection is
unavailable or CubeCL initialization panics.
Sourcepub fn device_ordinal(&self) -> usize
pub fn device_ordinal(&self) -> usize
Return the WebGPU device ordinal requested at construction.
§Examples
use tenferro_gpu::webgpu::WebGpuRuntime;
let _device_ordinal: fn(&WebGpuRuntime) -> usize = WebGpuRuntime::device_ordinal;Sourcepub fn runtime_identity(&self) -> WebGpuRuntimeIdentity
pub fn runtime_identity(&self) -> WebGpuRuntimeIdentity
Return the opaque identity of this exact executable runtime instance.
§Examples
use tenferro_gpu::webgpu::WebGpuRuntime;
let _identity: fn(&WebGpuRuntime) -> tenferro_gpu::webgpu::WebGpuRuntimeIdentity =
WebGpuRuntime::runtime_identity;Sourcepub fn synchronize(&self) -> Result<()>
pub fn synchronize(&self) -> Result<()>
Block the current thread until work submitted to the WebGPU queue completes.
§Examples
use tenferro_gpu::webgpu::WebGpuRuntime;
let _sync: fn(&WebGpuRuntime) -> tenferro_tensor::Result<()> =
WebGpuRuntime::synchronize;§Errors
Returns crate::Error::BackendSource when CubeCL queue synchronization fails.
Trait Implementations§
Source§impl Clone for WebGpuRuntime
impl Clone for WebGpuRuntime
Source§fn clone(&self) -> WebGpuRuntime
fn clone(&self) -> WebGpuRuntime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WebGpuRuntime
impl !UnwindSafe for WebGpuRuntime
impl Freeze for WebGpuRuntime
impl Send for WebGpuRuntime
impl Sync for WebGpuRuntime
impl Unpin for WebGpuRuntime
impl UnsafeUnpin for WebGpuRuntime
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
§impl<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
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