[tests] [common] added reduce.h to common headers

This commit is contained in:
Philippe Tillet
2019-10-19 16:53:48 -04:00
parent a76efd326d
commit 23db500edf
5 changed files with 164 additions and 81 deletions

View File

@@ -380,7 +380,16 @@ void layout::run(ir::module &mod) {
if(auto *red = dynamic_cast<ir::reduce_inst*>(i)) {
id++;
ir::value *arg = red->get_operand(0);
layouts_[id] = new layout_shared_t(get(arg), axes_->get(arg), arg->get_type()->get_tile_shapes(), {red}, red->get_type()->get_scalar_ty(), id, align_);
unsigned axis = red->get_axis();
// shape
auto shapes = arg->get_type()->get_tile_shapes();
unsigned shape_ax = shapes[axis];
const layout_t *layout = get(arg);
unsigned per_thread = layout->nts[axis];
unsigned depth = shape_ax / per_thread;
shapes[axis] = depth;
// create layout
layouts_[id] = new layout_shared_t(layout, axes_->get(arg), shapes, {red}, red->get_type()->get_scalar_ty(), id, align_);
tmp_[red] = id;
}
});