This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compute the sum of f in [0, extent_x) x [0, extent_y) | |
Func s("s"); | |
RDom r(0, extent_x, 0, extent_y); | |
s() += f(r.x, r.y); | |
// Schedule: rfactor the reduction in to vector_width x 4 tiles. | |
// This gives 4-way instruction level parallelism with SIMD. | |
// Requires that the extents are a multiple of the tile size. | |
RVar rxo, rxi, ryo, ryi; | |
Var x, y; |