Skip to content
fn

gpu_sink_index

::mlx::core::array gpu_sink_index(const ::mlx::core::array & idx, int extent)

Where an overwrite scatter sends each update under policy B: the index itself where it is in range, and extent otherwise. extent names a one-wide sink slab that the caller appends past the end of the axis and cuts off afterwards. Unlike a sum, a write cannot be made harmless: any value aimed at a real position overwrites it. So an out-of-range write gets a position of its own.