Skip to content

Support non-caching behavior in call_cached_indirect_function. - #9320

Open
mcourteaux wants to merge 2 commits into
mainfrom
mcourteaux/non-cached-indirect-calls
Open

Support non-caching behavior in call_cached_indirect_function.#9320
mcourteaux wants to merge 2 commits into
mainfrom
mcourteaux/non-cached-indirect-calls

Conversation

@mcourteaux

@mcourteaux mcourteaux commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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:

image

Breaking changes

While not technically ABI breaking, your compiler might complain if you have created your own halide_can_use_target_features() as the return-type is now halide_can_use_target_features_result_t instead of int.

We could revert it to int if 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; becomes return halide_can_use_feature_never;
  • return 1; becomes return halide_can_use_feature_always;
  • Change the return type, like I stated above.

UPDATE: I reverted the return type of that function to int to not break anyone's existing code.

Checklist

  • Tests added or updated (not required for docs, CI config, or typo fixes)
  • Documentation updated (if public API changed)
  • Python bindings updated (if public API changed)
  • Benchmarks are included here if the change is intended to affect performance.
  • Commits include AI attribution where applicable (see Code of Conduct)

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

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.03%. Comparing base (03a18bb) to head (56aed72).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant