pub struct WgpuRuntime<Compiler = AutoCompiler> { /* private fields */ }Expand description
Runtime that uses the wgpu crate.
The default AutoCompiler selects a native shader compiler when supported and falls back to
WGSL otherwise. Supply an explicit compiler type when fallback is not desired.
With msl enabled, AutoCompiler requires native MSL support for devices pinned to Metal;
an automatic device can still fall back to WGSL. An explicit crate::WgslCompiler continues
to use WGSL on Metal without requiring native MSL support.
For advanced configuration, use init_setup to pass runtime options or select a specific
graphics API.
Trait Implementations§
Source§impl<C> Clone for WgpuRuntime<C>
impl<C> Clone for WgpuRuntime<C>
Source§impl<Compiler: Debug> Debug for WgpuRuntime<Compiler>
impl<Compiler: Debug> Debug for WgpuRuntime<Compiler>
Source§impl<C: WgpuCompiler> Runtime for WgpuRuntime<C>
impl<C: WgpuCompiler> Runtime for WgpuRuntime<C>
Source§fn enumerate_all_devices() -> Vec<DeviceId>
fn enumerate_all_devices() -> Vec<DeviceId>
Each adapter once, on whichever graphics API WgpuBackend::Auto
settles on — which is what a client created lazily resolves these ids
against. The same adapter pinned to another API is a device a caller
names, not one more to count.
Source§type Server = WgpuServer<C>
type Server = WgpuServer<C>
Source§type Device = WgpuDevice
type Device = WgpuDevice
Source§fn can_read_tensor(shape: &Shape, strides: &Strides) -> bool
fn can_read_tensor(shape: &Shape, strides: &Strides) -> bool
shape and strides can be read as is. If the result is false, the
tensor should be made contiguous before reading.Source§fn target_properties() -> TargetProperties
fn target_properties() -> TargetProperties
Source§fn enumerate_devices(type_id: u16) -> Vec<DeviceId>
fn enumerate_devices(type_id: u16) -> Vec<DeviceId>
Source§fn is_available() -> bool
fn is_available() -> bool
Source§fn enumerate_devices_like(device_id: DeviceId) -> Vec<DeviceId>
fn enumerate_devices_like(device_id: DeviceId) -> Vec<DeviceId>
device_id’s own kind: its peers, and itself where the
machine has it. Read moreSource§fn utilization(
device: &Self::Device,
) -> Result<DeviceUtilization, UtilizationUnavailable>
fn utilization( device: &Self::Device, ) -> Result<DeviceUtilization, UtilizationUnavailable>
device is, by the counter its card’s driver or its platform keeps. Asking
creates the device’s client, and must never wait on the work the device is running. Read moreAuto Trait Implementations§
impl<Compiler> Freeze for WgpuRuntime<Compiler>where
PhantomData<Compiler>: Freeze,
impl<Compiler> RefUnwindSafe for WgpuRuntime<Compiler>where
PhantomData<Compiler>: RefUnwindSafe,
impl<Compiler> Send for WgpuRuntime<Compiler>where
PhantomData<Compiler>: Send,
impl<Compiler> Sync for WgpuRuntime<Compiler>where
PhantomData<Compiler>: Sync,
impl<Compiler> Unpin for WgpuRuntime<Compiler>where
PhantomData<Compiler>: Unpin,
impl<Compiler> UnsafeUnpin for WgpuRuntime<Compiler>where
PhantomData<Compiler>: UnsafeUnpin,
impl<Compiler> UnwindSafe for WgpuRuntime<Compiler>where
PhantomData<Compiler>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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