Skip to content

Instantly share code, notes, and snippets.

View dsharletg's full-sized avatar

Dillon Sharlet dsharletg

View GitHub Profile
// 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;