Skip to content

RDoms extending past the edge of an image trigger assert, even though .where clause prevents bad memory access #2373

Description

@steven-johnson

From an internal source:


Consider the following code:

Var x, y, z;
RDom r(0, 32);
r.where(x >= r);

Func volume;
volume(x, y, z) = Halide::undef<uint32_t>();
volume(x, y, r) = input(x - r, y);

This code fails to generate with a complaint about out of bounds access. The assert is part of the big pile of asserts in the preamble of the function, and can be turned off by compiling with target feature no_asserts, so it is not a blocker; but it would be nice if I could retain the safety of the the access checks in this scenario.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions