pub struct KeyValueSorter { /* private fields */ }Expand description
Performs a stable LSD radix sort of KeyValue items by key on a wgpu device.
Implementations§
Source§impl KeyValueSorter
impl KeyValueSorter
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: &[KeyValue]) -> Result<Vec<KeyValue>, Error>
pub async fn sort(&mut self, input: &[KeyValue]) -> Result<Vec<KeyValue>, Error>
Uploads items, stably sorts them by key, and downloads the 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>
Stably 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 stable GPU key-value radix sort without submitting or waiting.
Auto Trait Implementations§
impl !RefUnwindSafe for KeyValueSorter
impl !UnwindSafe for KeyValueSorter
impl Freeze for KeyValueSorter
impl Send for KeyValueSorter
impl Sync for KeyValueSorter
impl Unpin for KeyValueSorter
impl UnsafeUnpin for KeyValueSorter
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