module

GS::Metal::GPURadixSort

GPU Radix Sort module

Constants

BLOCK_SIZE = 256
LOCAL_SORT_THRESHOLD = 512
NUM_BUCKETS = 16
RADIX_BITS = 4
RADIX_SORT_SOURCE = {{ read_file("/tmp/tmp.faCcNO/src/src/metal/kernels/radix_sort.metal") }}

Load radix sort kernel source at compile time

Instance methods

available?

Check availability

Source
compute_tile_ranges!(sorted_keys : MetalBuffer, tile_ranges : MetalBuffer, n : Int32, num_tiles : Int32) : Nil

Compute tile ranges after sorting

Source
ensure_initialized

Lazy init

Source
get_pipeline(name : String) : ComputePipeline

Get or create pipeline

Source
sort!(keys : MetalBuffer, values : MetalBuffer, n : Int32) : Nil

Sort 64-bit keys with associated 32-bit values keys: uint64 buffer (tile_id << 32 | depth) values: uint32 buffer (gaussian IDs) n: number of elements

Source