Skip to content

bad performance due to define_extern #8028

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

You must be logged in to vote

I should add - we do have the mechanism to provide the compiler with a proxy expression that Halide should use for bounds relationships, (e.g. the bounds of this extern stage are as if it accessed these expressions in its inputs), but we don't have that plumbed through to the front-end. I'm not entirely sure the following works, you can try using the form of define_extern that takes a list of Vars instead of a numeric dimensionality, and then hackily set it like so:

u8Dst_dtcm.define_extern("boxFilter5x5_wrap_u8", {input_func}, UInt(8), {x, y}, NameMangling::C);
u8Dst_dtcm.function().extern_definition_proxy_expr() = input_func(x-2, y-2) + input_func(x+2, y+2); // Accesses a 5x5 window

If…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by shaniaba
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