Skip to content

Commit

Permalink
Fix instances where we were constructing Vars for RVars
Browse files Browse the repository at this point in the history
There was one instance in fit_function.cpp, and the autoscheduler was
doing it in the generated schedules. This may cause errors in existing
generated schedules that have been checked in.
  • Loading branch information
abadams committed Oct 18, 2024
1 parent 21b6270 commit 524ae11
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/autoschedulers/adams2019/LoopNest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ void LoopNest::apply(LoopLevel here,
for (size_t i = 0; i < symbolic_loop.size(); i++) {
StageScheduleState::FuncVar fv;
const auto &l = symbolic_loop[i];
fv.var = VarOrRVar(l.var, !l.pure);
fv.var = VarOrRVar(l.var, l.rvar);
fv.orig = fv.var;
fv.accessor = l.accessor;
const auto &p = parent_bounds->loops(stage->index, i);
Expand Down
4 changes: 2 additions & 2 deletions src/autoschedulers/adams2019/cost_model_schedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ inline void do_cost_model_schedule(Halide::Pipeline pipeline) {
Var n(sum.get_schedule().dims()[0].var);
Var ni("ni");
Var nii("nii");
Var r1010_z(filter1_im_0_d_def__.update(0).get_schedule().dims()[2].var);
Var r1207_y(filter1_im_0_d_def__.update(1).get_schedule().dims()[1].var);
RVar r1010_z(filter1_im_0_d_def__.update(0).get_schedule().dims()[2].var);
RVar r1207_y(filter1_im_0_d_def__.update(1).get_schedule().dims()[1].var);
Var s(squashed_head1_filter_0_d_def__.get_schedule().dims()[1].var);
Var si("si");
Var v12(head2_bias_im_0_d_def__.get_schedule().dims()[0].var);
Expand Down
2 changes: 1 addition & 1 deletion test/correctness/fit_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main(int argc, char **argv) {
// Find a pure var to vectorize over
for (auto d : df.update(i).get_schedule().dims()) {
if (d.is_pure()) {
df.update(i).vectorize(Var(d.var), 4);
df.update(i).vectorize(VarOrRVar(d.var, d.is_rvar()), 4);
break;
}
}
Expand Down

0 comments on commit 524ae11

Please sign in to comment.