Skip to content
fn

gpu_sort_order

int gpu_sort_order(const int & a, int axis)

argsort that also takes bool. MLX ships no bool sort kernel — sorting a bool tensor on Metal died with "Unable to load kernel carg_block_sort_bool_…" — so the order is taken on uint8, where false < true exactly as for bool, and the caller gathers the original values with it.