dillonhuff / clockwork

A polyhedral compiler for hardware accelerators
56 stars 12 forks source link

harris_sch6 has a buffer that is not an input but has no writers? #93

Closed dillonhuff closed 4 years ago

dillonhuff commented 4 years ago

@jeffsetter when I run 'prg.sanity_check()onharris_sch6` I get:

Error: grad_x_unclamp_stencil has 2 readers, but it is never written.

Should this buffer be an input?

jeffsetter commented 4 years ago

There was a weird error in my Halide schedule where grad_x_unclamp wasn't being produced. I was able to fix it in https://github.com/dillonhuff/clockwork/pull/94

dillonhuff commented 4 years ago

@jeffsetter thanks! I just merged. Now I get the error:

op_hcompute_lgxy_stencil is not a producer or consumer of any dependency
jeffsetter commented 4 years ago

What does that mean? I see that it is used here:

  auto hcompute_lgxy_stencil = lgxy_s0_x_x->add_op("op_hcompute_lgxy_stencil");
  hcompute_lgxy_stencil->add_function("hcompute_lgxy_stencil");
  prg.buffer_port_widths["lgxy_stencil"] = 16;
  hcompute_lgxy_stencil->add_store("lgxy_stencil", "lgxy_s0_y", "((lgxy_s0_x_x*2) + -1)");

And later hcompute_lgxy_stencil_2 uses it hcompute_lgxy_stencil_2->add_load("lgxy_stencil", "lgxy_s1_y", "lgxy_s1_x");

Is there an issue with this store in between?

  auto hcompute_lgxy_stencil_1 = lgxy_s0_x_x->add_op("op_hcompute_lgxy_stencil_1");
  hcompute_lgxy_stencil_1->add_function("hcompute_lgxy_stencil_1");
  hcompute_lgxy_stencil_1->add_store("lgxy_stencil", "lgxy_s0_y", "(lgxy_s0_x_x*2)");
  auto lgxy_s1_y = prg.add_loop("lgxy_s1_y", -1, 59);
  auto lgxy_s1_x = lgxy_s1_y->add_loop("lgxy_s1_x", -1, 59);