Skip to content

Working with misaligned image buffers #7983

Answered by abadams
icebeing asked this question in Q&A
Discussion options

You must be logged in to vote

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:

f(x, y) = my_input(x, y) * 2;
output(x, y) = f(x / 3, y / 3) + 3;

f.compute_root().align_storage(x, 16);

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.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@icebeing
Comment options

@abadams
Comment options

@icebeing
Comment options

@abadams
Comment options

Answer selected by icebeing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants