pub struct WgpuServer {
pub compilation_options: WgpuCompilationOptions,
/* private fields */
}Expand description
Wgpu compute server.
Fields§
§compilation_options: WgpuCompilationOptionsImplementations§
Source§impl WgpuServer
impl WgpuServer
pub fn create_pipeline( &mut self, kernel: CompiledKernel<AutoCompiler>, mode: ExecutionMode, ) -> Arc<ComputePipeline>
Source§impl WgpuServer
impl WgpuServer
Sourcepub 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
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
impl ComputeServer for WgpuServer
Source§fn sync(&mut self, stream_id: StreamId) -> DynFut<()>
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>>
type Kernel = Box<dyn CubeTask<AutoCompiler>>
The kernel type defines the computation algorithms.
Source§type Storage = WgpuStorage
type Storage = WgpuStorage
The storage type defines how data is stored and accessed.
Source§fn logger(&self) -> Arc<ServerLogger>
fn logger(&self) -> Arc<ServerLogger>
Retrieve the server logger.
Source§fn utilities(&self) -> Arc<ServerUtilities<Self>>
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>
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>>
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>
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>
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,
)
unsafe fn execute( &mut self, kernel: Self::Kernel, count: CubeCount, bindings: Bindings, mode: ExecutionMode, stream_id: StreamId, )
Source§fn start_profile(&mut self, stream_id: StreamId) -> ProfilingToken
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>
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
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)
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)
fn allocation_mode(&mut self, mode: MemoryAllocationMode, stream_id: StreamId)
Update the memory mode of allocation in the server.
Source§impl Debug for WgpuServer
impl Debug for WgpuServer
Source§impl DeviceState for WgpuServer
impl DeviceState for WgpuServer
Source§impl ServerCommunication for WgpuServer
impl ServerCommunication for WgpuServer
Source§const SERVER_COMM_ENABLED: bool = false
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>
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§
impl Freeze for WgpuServer
impl !RefUnwindSafe for WgpuServer
impl Send for WgpuServer
impl Sync for WgpuServer
impl Unpin for WgpuServer
impl !UnwindSafe for WgpuServer
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