halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.78k stars 1.07k forks source link

A Func with a specialized with more splits than the default specialization is incorrectly assumed to be part of a compute_with group #8317

Open abadams opened 1 week ago

abadams commented 1 week ago

The cause is https://github.com/halide/Halide/blob/main/src/ScheduleFunctions.cpp#L1514

The sentinel value used is the number of post-split dims in the default specialization, which is not a good sentinel for the specialization definition. I'd switch to a different sentinel (e.g. -1), but you still have #8316 to deal with. I think this code should do the whole find_if dance per specialization, and not once out here. That would be in build_provide_loop_nest.