pub struct Sorter { /* private fields */ }Expand description
Performs an unsigned 32-bit LSD radix sort on a wgpu device.
Implementations§
Source§impl Sorter
impl Sorter
Sourcepub fn new(device: &Device, queue: &Queue) -> Self
pub fn new(device: &Device, queue: &Queue) -> Self
Creates a sorter that submits work through an existing wgpu device and queue.
Sourcepub fn from_context(ctx: &Context) -> Self
pub fn from_context(ctx: &Context) -> Self
Creates a sorter from the crate’s optional convenience context.
Sourcepub async fn sort(&mut self, input: &[u32]) -> Result<Vec<u32>, Error>
pub async fn sort(&mut self, input: &[u32]) -> Result<Vec<u32>, Error>
Uploads values, sorts them on the GPU, and downloads the sorted result.
Sourcepub fn sort_gpu_to_gpu(
&mut self,
input: &Buffer,
output: &Buffer,
num_items: u32,
) -> Result<(), Error>
pub fn sort_gpu_to_gpu( &mut self, input: &Buffer, output: &Buffer, num_items: u32, ) -> Result<(), Error>
Sorts caller-owned GPU buffers and submits the work immediately.
Sourcepub fn record_sort(
&mut self,
encoder: &mut CommandEncoder,
input: &Buffer,
output: &Buffer,
num_items: u32,
) -> Result<(), Error>
pub fn record_sort( &mut self, encoder: &mut CommandEncoder, input: &Buffer, output: &Buffer, num_items: u32, ) -> Result<(), Error>
Records a GPU radix sort without submitting or waiting for the work.
Auto Trait Implementations§
impl !RefUnwindSafe for Sorter
impl !UnwindSafe for Sorter
impl Freeze for Sorter
impl Send for Sorter
impl Sync for Sorter
impl Unpin for Sorter
impl UnsafeUnpin for Sorter
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