Deprecate the Generator::build() method #6580
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes the use of the
build()
method in Generators unsupported by default in Halide 14. The newer,generate()
based approach has been preferred for quite some time, and it is believed that very few downstream users still have any code in that form. (Halide itself only has a couple of remaining uses, and they exist only to verify that the build() method still works.)This hides all support for
build()
behind theHALIDE_ALLOW_GENERATOR_BUILD_METHOD
preprocessor flag, which defaults to undefined -- Generators with build() methods won't compile in this state.To allow downstream users time to adapt any remaining code, they can #define
HALIDE_ALLOW_GENERATOR_BUILD_METHOD
in their build system, which will allow the old code to compile (with deprecation warnings).The intent here is to ship Halide 14 with this deprecation in place, then remove the support entirely in Halide 15.
(At this time LLVM 14 is scheduled to go final in roughly mid-March 2022, so it's likely that Halide 14 will follow in early April 2022 or so.)