pub trait AsyncGpuOps {
// Required methods
fn launch_async(
&self,
workgroups: [u32; 3],
stream: &Arc<GpuStream>,
) -> Arc<GpuEvent>;
fn copy_async<T: GpuDataType>(
&self,
src: &GpuBuffer<T>,
dst: &GpuBuffer<T>,
stream: &Arc<GpuStream>,
) -> Arc<GpuEvent>;
fn copy_from_host_async<T: GpuDataType>(
&self,
src: &[T],
dst: &GpuBuffer<T>,
stream: &Arc<GpuStream>,
) -> Arc<GpuEvent>;
fn copy_to_host_async<T: GpuDataType>(
&self,
src: &GpuBuffer<T>,
dst: &mut [T],
stream: &Arc<GpuStream>,
) -> Arc<GpuEvent>;
}Expand description
Extension trait for adding async capabilities to GPU operations
Required Methods§
Sourcefn launch_async(
&self,
workgroups: [u32; 3],
stream: &Arc<GpuStream>,
) -> Arc<GpuEvent>
fn launch_async( &self, workgroups: [u32; 3], stream: &Arc<GpuStream>, ) -> Arc<GpuEvent>
Launch a kernel asynchronously
Sourcefn copy_async<T: GpuDataType>(
&self,
src: &GpuBuffer<T>,
dst: &GpuBuffer<T>,
stream: &Arc<GpuStream>,
) -> Arc<GpuEvent>
fn copy_async<T: GpuDataType>( &self, src: &GpuBuffer<T>, dst: &GpuBuffer<T>, stream: &Arc<GpuStream>, ) -> Arc<GpuEvent>
Copy data asynchronously
Sourcefn copy_from_host_async<T: GpuDataType>(
&self,
src: &[T],
dst: &GpuBuffer<T>,
stream: &Arc<GpuStream>,
) -> Arc<GpuEvent>
fn copy_from_host_async<T: GpuDataType>( &self, src: &[T], dst: &GpuBuffer<T>, stream: &Arc<GpuStream>, ) -> Arc<GpuEvent>
Copy from host asynchronously
Sourcefn copy_to_host_async<T: GpuDataType>(
&self,
src: &GpuBuffer<T>,
dst: &mut [T],
stream: &Arc<GpuStream>,
) -> Arc<GpuEvent>
fn copy_to_host_async<T: GpuDataType>( &self, src: &GpuBuffer<T>, dst: &mut [T], stream: &Arc<GpuStream>, ) -> Arc<GpuEvent>
Copy to host asynchronously
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.