pub struct WgpuRuntime<Compiler = AutoCompiler> { /* private fields */ }Expand description
Runtime that uses the wgpu crate with the wgsl compiler. This is used in the Wgpu backend.
For advanced configuration, use init_setup to pass in runtime options or to 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§type Server = WgpuServer<C>
type Server = WgpuServer<C>
The compute server used to run kernels and perform autotuning.
Source§type Device = WgpuDevice
type Device = WgpuDevice
The device used to retrieve the compute client.
Source§fn client(device: &Self::Device) -> ComputeClient<Self>
fn client(device: &Self::Device) -> ComputeClient<Self>
Retrieve the compute client from the runtime device.
Source§fn name(client: &ComputeClient<Self>) -> &'static str
fn name(client: &ComputeClient<Self>) -> &'static str
The runtime name on the given device.
Source§fn max_cube_count() -> (u32, u32, u32)
fn max_cube_count() -> (u32, u32, u32)
Returns the maximum cube count on each dimension that can be launched.
Source§fn can_read_tensor(shape: &Shape, strides: &Strides) -> bool
fn can_read_tensor(shape: &Shape, strides: &Strides) -> bool
Whether a tensor with
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
Returns the properties of the target hardware architecture.
Source§fn enumerate_devices(type_id: u16, info: &Backend) -> Vec<DeviceId>
fn enumerate_devices(type_id: u16, info: &Backend) -> Vec<DeviceId>
Returns all devices available under the provided type id.
Source§fn enumerate_all_devices(info: &Backend) -> Vec<DeviceId>
fn enumerate_all_devices(info: &Backend) -> Vec<DeviceId>
Returns all devices that can be handled by the runtime.
Source§fn require_array_lengths() -> bool
fn require_array_lengths() -> bool
Return true if global input array lengths should be added to kernel info.
Auto 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
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
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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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
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