-
Hi all - So, I've been looking over the above helper Func. Would this be a function object that effectively constrains a buffer's contents to only exist within a certain sub-rectangle? Let's say I have the following: To ignore the noise part of the input, I can define this Func object:
I think the ./test/correctness/boundary_conditions.cpp Unit-test hints at the answer, but I just wanted to know from someone that's used this function before. Thanks, Charles. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I wouldn't say it constrains it to only exist within a sub-rectangle. I'd say it is a Func that equals the first arg (a Func) within some subrectangle, and equals the second arg (a constant) outside of that subrectangle. Typically when you vectorize this Halide will split the loop over vectors into three parts: a prologue for vectors that are before or overlapping the left edge, a steady-state for vectors entirely within the Func arg, and an epilogue for vectors that are after or overlapping the right edge. Compiling to stmt_html and reading the result might be illuminating. |
Beta Was this translation helpful? Give feedback.
I wouldn't say it constrains it to only exist within a sub-rectangle. I'd say it is a Func that equals the first arg (a Func) within some subrectangle, and equals the second arg (a constant) outside of that subrectangle.
Typically when you vectorize this Halide will split the loop over vectors into three parts: a prologue for vectors that are before or overlapping the left edge, a steady-state for vectors entirely within the Func arg, and an epilogue for vectors that are after or overlapping the right edge.
Compiling to stmt_html and reading the result might be illuminating.