WgpuServer

Struct WgpuServer 

Source
pub struct WgpuServer {
    pub compilation_options: WgpuCompilationOptions,
    /* private fields */
}
Expand description

Wgpu compute server.

Fields§

§compilation_options: WgpuCompilationOptions

Implementations§

Source§

impl WgpuServer

Source§

impl WgpuServer

Source

pub fn new( memory_properties: MemoryDeviceProperties, memory_config: MemoryConfiguration, compilation_options: WgpuCompilationOptions, device: Device, queue: Queue, tasks_max: usize, backend: Backend, timing_method: TimingMethod, utilities: ServerUtilities<Self>, ) -> Self

Create a new server.

Trait Implementations§

Source§

impl ComputeServer for WgpuServer

Source§

fn sync(&mut self, stream_id: StreamId) -> DynFut<()>

Returns the total time of GPU work this sync completes.

Source§

type Kernel = Box<dyn CubeTask<AutoCompiler>>

The kernel type defines the computation algorithms.
Source§

type Storage = WgpuStorage

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

type Info = Backend

Information that can be retrieved for the runtime.
Source§

fn logger(&self) -> Arc<ServerLogger>

Retrieve the server logger.
Source§

fn utilities(&self) -> Arc<ServerUtilities<Self>>

Retrieve the server utilities.
Source§

fn create( &mut self, descriptors: Vec<AllocationDescriptor<'_>>, stream_id: StreamId, ) -> Result<Vec<Allocation>, IoError>

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

fn read<'a>( &mut self, descriptors: Vec<CopyDescriptor<'a>>, stream_id: StreamId, ) -> DynFut<Result<Vec<Bytes>, IoError>>

Given bindings, returns the owned resources as bytes.
Source§

fn write( &mut self, descriptors: Vec<(CopyDescriptor<'_>, &[u8])>, stream_id: StreamId, ) -> Result<(), IoError>

Writes the specified bytes into the buffers given
Source§

fn get_resource( &mut self, binding: Binding, stream_id: StreamId, ) -> BindingResource<WgpuResource>

Given a resource handle, returns the storage resource.
Source§

unsafe fn execute( &mut self, kernel: Self::Kernel, count: CubeCount, bindings: Bindings, mode: ExecutionMode, stream_id: StreamId, )

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

fn flush(&mut self, stream_id: StreamId)

Flush all outstanding tasks in the server.
Source§

fn start_profile(&mut self, stream_id: StreamId) -> ProfilingToken

Enable collecting timestamps.
Source§

fn end_profile( &mut self, stream_id: StreamId, token: ProfilingToken, ) -> Result<ProfileDuration, ProfileError>

Disable collecting timestamps.
Source§

fn memory_usage(&mut self, stream_id: StreamId) -> MemoryUsage

The current memory usage of the server.
Source§

fn memory_cleanup(&mut self, stream_id: StreamId)

Ask the server to release memory that it can release.
Source§

fn allocation_mode(&mut self, mode: MemoryAllocationMode, stream_id: StreamId)

Update the memory mode of allocation in the server.
Source§

fn create_with_data( &mut self, data: &[u8], stream_id: StreamId, ) -> Result<Handle, IoError>

Utility to create a new buffer and immediately copy contiguous data into it
Source§

impl Debug for WgpuServer

Source§

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

Formats the value using the given formatter. Read more
Source§

impl DeviceState for WgpuServer

Source§

fn init(device_id: DeviceId) -> Self

Initialize a new state on the given device.
Source§

impl ServerCommunication for WgpuServer

Source§

const SERVER_COMM_ENABLED: bool = false

Indicates whether server-to-server communication is enabled for this implementation.
Source§

fn copy( server_src: &mut Self, server_dst: &mut Self, src: CopyDescriptor<'_>, stream_id_src: StreamId, stream_id_dst: StreamId, ) -> Result<Allocation, IoError>

Copies data from a source server to a destination server. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> Upcast<T> for T

Source§

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

Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,