pub struct WgpuServer<MM: MemoryManagement<WgpuStorage>> { /* private fields */ }
Expand description

Wgpu compute server.

Implementations§

source§

impl<MM> WgpuServer<MM>where MM: MemoryManagement<WgpuStorage>,

source

pub fn new( memory_management: MM, device: Arc<Device>, queue: Queue, max_tasks: usize ) -> Self

Create a new server.

Trait Implementations§

source§

impl<MM> ComputeServer for WgpuServer<MM>where MM: MemoryManagement<WgpuStorage>,

source§

fn create(&mut self, data: &[u8]) -> Handle<Self>

When we create a new handle from existing data, we use custom allocations so that we don’t have to execute the current pending tasks.

This is important, otherwise the compute passes are going to be too small and we won’t be able to fully utilize the GPU.

§

type Kernel = Box<dyn Kernel>

The kernel type defines the computation algorithms.
§

type Storage = WgpuStorage

The storage type defines how data is stored and accessed.
§

type MemoryManagement = MM

The memory management type defines strategies for allocation in the storage type.
§

type AutotuneKey = WgpuAutotuneKey

The key used to cache operations used on specific inputs in autotune
source§

fn read(&mut self, handle: &Handle<Self>) -> Reader<Vec<u8>>

Given a handle, returns the owned resource as bytes.
source§

fn empty(&mut self, size: usize) -> Handle<Self>

Reserves size bytes in the storage, and returns a handle over them.
source§

fn execute(&mut self, kernel: Self::Kernel, handles: &[&Handle<Self>])

Executes the kernel over the given memory handles. Read more
source§

fn sync(&mut self)

Wait for the completion of every task in the server.
source§

impl<MM: Debug + MemoryManagement<WgpuStorage>> Debug for WgpuServer<MM>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<MM> !RefUnwindSafe for WgpuServer<MM>

§

impl<MM> Send for WgpuServer<MM>

§

impl<MM> Sync for WgpuServer<MM>where MM: Sync, <MM as MemoryManagement<WgpuStorage>>::Handle: Sync,

§

impl<MM> Unpin for WgpuServer<MM>where MM: Unpin, <MM as MemoryManagement<WgpuStorage>>::Handle: Unpin,

§

impl<MM> !UnwindSafe for WgpuServer<MM>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WasmNotSend for Twhere T: Send,

§

impl<T> WasmNotSync for Twhere T: Sync,