-
Hello all - I'm developing a simple "image subtraction" generator class (let's call it BGSub). The "runner" code does the following steps: the BGSub::schedule() method is written as follows: ` Var xi{"xi"}, yi{"yi"};
` So, when this code tries to invoke xxx.set_stride(...) with the new value, I get this error: So, I'm wondering if the better approach is to set the desired stride value when one first decodes the PNG images? How would I do that to not bump into this crash (which seems like an assertion). Basically; the original input image rows are not aligned to the alignment data-lane. How do I ensure this, and not crash? Thanks, charles. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Those set_stride calls are asking Halide to generate assertions that the strides of the buffers in question are aligned. Halide doesn't allocate the inputs and outputs though, so it is up to the calling code to make that true. So yes, I think you'd have to do it when decoding the PNG. |
Beta Was this translation helpful? Give feedback.
internal Funcs are ones that aren't inputs or outputs, where the Halide pipeline is doing the allocating. E.g in the following code, f is not an input or an output, so the generated halide pipeline is responsible for allocating it and freeing it, so align_storage is meaningful:
In general the alignment of the input and output buffers doesn't tell you much about the alignment of intermediates. In that example, even if output happens to be a multiple of 16 wide, that doesn't tell you that the intermediate is a multiple of 16 wide.