Make Metal intrinsics device-only#849
Open
napes wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #849 +/- ##
==========================================
- Coverage 84.00% 83.63% -0.37%
==========================================
Files 69 69
Lines 4400 4394 -6
==========================================
- Hits 3696 3675 -21
- Misses 704 719 +15 ☔ 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.
Summary
This marks the Metal barrier and version intrinsics as device functions so host-side AOT/codegen does not emit AIR/Metal device-only references for these APIs.
The change keeps the existing docstrings attached to the public functions while moving the actual intrinsic bodies behind
@device_function.Why
Including Metal in a host sysimage can expose device-only AIR/Metal symbols to the host linker. These intrinsics are only valid for Metal device compilation and should not create host link obligations.
Validation
JuliaGPU/Metal.jl:mainat224d0e29.git merge-tree --write-tree upstream/main HEADcompleted successfully, producing merge treecfb1bf62cfd5171e8eeeac7f0e80850bf00fa866.julia --project scripts/check_host_device_intrinsic_regression.jlpassed from the repro environment with required failures: 0 and candidate leaks: 0.Notes
The repro environment resolved
Metal v1.10.0from/Users/ian/Documents/Metal.jlandGPUCompiler v1.22.3fromJuliaGPU/GPUCompiler.jl#main.