Support non-caching behavior in call_cached_indirect_function. - #9320
Open
mcourteaux wants to merge 2 commits into
Open
Support non-caching behavior in call_cached_indirect_function.#9320mcourteaux wants to merge 2 commits into
mcourteaux wants to merge 2 commits into
Conversation
This allows one to dynamically change CPU target features which are allowed and which are not allowed to run performance benchmarks. Also can be used to latency-hide GPU Compute API setup by returning "not_right_now" when asked for e.g. CUDA.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9320 +/- ##
==========================================
+ Coverage 69.83% 70.03% +0.20%
==========================================
Files 258 258
Lines 78210 78225 +15
Branches 19037 19037
==========================================
+ Hits 54617 54787 +170
+ Misses 17832 17791 -41
+ Partials 5761 5647 -114 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This allows one to dynamically change CPU target features which are allowed and which are not allowed to run performance benchmarks. Also can be used to latency-hide GPU Compute API setup by returning "not_right_now" when asked for e.g. CUDA.
The LLVM bit was done with the help of Gemini Pro 3.1, but I went through it and understood it all. Validated the logic with Hopper Disassembler:
Breaking changes
While not technically ABI breaking, your compiler might complain if you have created your ownhalide_can_use_target_features()as the return-type is nowhalide_can_use_target_features_result_tinstead ofint.We could revert it tointif people want that. Personally, I would like to get an error about this, as that reveals to me there is a new feature. Dealing with this change is trivial:return 0;becomesreturn halide_can_use_feature_never;return 1;becomesreturn halide_can_use_feature_always;Change the return type, like I stated above.UPDATE: I reverted the return type of that function to
intto not break anyone's existing code.Checklist