Skip to content

Autoscheduled code doesn't work on buffers smaller than estimates #3953

Open
@slepa

Description

@slepa
  1. Generate function
#include <Halide.h>
using namespace Halide;

int main() {
  ImageParam input(type_of<float>(), 2);
  Func f, in_b = BoundaryConditions::constant_exterior(input, 0.f);
  Var x, y, xo, xi;
  f(x, y) = 0.f;
  in_b.compute_at(f, xo);
  f.compute_root().split(x, xo, xi, 64);
  f.compile_to_static_library("make_zero", { input }, "make_zero");
}
  1. Run function
#include "make_zero.h"
#include "HalideBuffer.h"

int main() {
  float in[64], out[64];
  Halide::Runtime::Buffer<float, 1> input(in, 8, 8), output(out, 8, 8);
  make_zero(input, output);
}

Error: Output buffer f1 is accessed at -56, which is before the min (0) in dimension 0
Aborted (core dumped)

Master 21f3be8 built with clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04 by gcc 7.4.0-1ubuntu1~18.04._

Metadata

Metadata

Assignees

No one assigned

    Labels

    autoschedulerRelated to one or more of the AutoschedulersenhancementNew user-visible features or improvements to existing features.usability

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions