Fix default device wrap native function#6310
Merged
abadams merged 2 commits intohalide:masterfrom Oct 25, 2021
Merged
Conversation
Currently, an attempt to call device_wrap_native on a target that uses the default device wrap native function will result in an error of type halide_error_device_interface_no_device, namely in the OpenGLCompute and the Hexagon targets. This happens because the default wrap native function calls debug_log_and_validate_buf after the device_interface is set in halide_device_wrap_native but before the device handle is set, which is validated as a bad state. This patch removes the validation call and adds an assert for the handle much like the other wrap_native implementations in other targets.
abadams
approved these changes
Oct 12, 2021
Member
abadams
left a comment
There was a problem hiding this comment.
Looks correct to me. Thanks for the fix!
dsharletg
reviewed
Oct 12, 2021
Contributor
Author
|
Perhaps this was missed, do I need to do anything else for this pull request? |
Member
|
Yes it was missed. Thanks for the ping. |
Contributor
|
Update: this is causing some issues downstream, and I wonder at the logic of this change: |
Contributor
|
(side note: we should rename |
steven-johnson
added a commit
that referenced
this pull request
Nov 3, 2021
This was inserted in #6310, probably mistakenly, since `halide_assert()` in the Halide runtime is *not* a debug-only assertion). Instead of a controlled runtime failure, we just abort, which is not OK.
steven-johnson
added a commit
that referenced
this pull request
Nov 3, 2021
This was inserted in #6310, probably mistakenly, since `halide_assert()` in the Halide runtime is *not* a debug-only assertion). Instead of a controlled runtime failure, we just abort, which is not OK.
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.
Currently, an attempt to call
device_wrap_nativeon a target that usesthe default device wrap native function will result in an error of type
halide_error_device_interface_no_device, namely in the OpenGLCompute andthe Hexagon targets. This happens because the default wrap native
function calls
debug_log_and_validate_bufafter thedevice_interfaceisset in
halide_device_wrap_nativebut before thedevicehandle is set,which is validated as a bad state.
This patch removes the validation call and adds an assert for the handle
much like the other wrap_native implementations in other targets.