I think this is important enough to repeat: Halide doesn't by itself generate the ridiculously fast code mentioned above. By separating correctness and performance concerns for an image processing routine, it is much easier to try different schedules, while only writing the (possibly difficult) algorithm once. This is likely the reason pure functions were chosen to represent images, because these are very easy to reason about, and they prevent the programmer from thinking about performance details.
I think this is important enough to repeat: Halide doesn't by itself generate the ridiculously fast code mentioned above. By separating correctness and performance concerns for an image processing routine, it is much easier to try different schedules, while only writing the (possibly difficult) algorithm once. This is likely the reason pure functions were chosen to represent images, because these are very easy to reason about, and they prevent the programmer from thinking about performance details.
This comment was marked helpful 0 times.