Add halide_debug_assert() macro (#6384)#6385
Closed
steven-johnson wants to merge 9 commits intosrj/halide_assertfrom
Closed
Add halide_debug_assert() macro (#6384)#6385steven-johnson wants to merge 9 commits intosrj/halide_assertfrom
halide_debug_assert() macro (#6384)#6385steven-johnson wants to merge 9 commits intosrj/halide_assertfrom
Conversation
Member
|
Do we really need to litter the code long all caps names? We should use lots of asserts and checks and this approach is just horrible from a readability point of view. It draws massive attention to the name of the macro, which is just not at all interesting. It's like if every if statement was written "HEY_IM_AN_IF_STATEMENT_PAY_ATTENTION_TO_ME". |
abadams
approved these changes
Nov 3, 2021
Contributor
Author
For HALIDE_CHECK I think that SCREAMING_SNAKE_CASE is appropriate because it really should jump out at you. For debug-assert, though, probably not. would |
HALIDE_DEBUG_ASSERT() macro (#6384)halide_debug_assert() macro (#6384)
Contributor
Author
|
(This needs #6382 to land first) |
steven-johnson
added a commit
that referenced
this pull request
Nov 4, 2021
Also convert usage of halide_assert()/HALIDE_CHECK() in hashmap.h and gpu_context_common.h to halide_debug_assert(), as all the usages looked to be appropriate for debug-mode only. (Rebased version of #6385, which this replaces)
Contributor
Author
|
Closing in favor of identical-but-rebased #6390 |
steven-johnson
added a commit
that referenced
this pull request
Nov 8, 2021
* Add halide_debug_assert() macro Also convert usage of halide_assert()/HALIDE_CHECK() in hashmap.h and gpu_context_common.h to halide_debug_assert(), as all the usages looked to be appropriate for debug-mode only. (Rebased version of #6385, which this replaces) * appease clang-format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Also convert usage of
halide_assert()/HALIDE_CHECK()in hashmap.h and gpu_context_common.h tohalide_debug_assert(), as all the usages looked to be appropriate for debug-mode only.