Skip to content

Make Metal intrinsics device-only#849

Open
napes wants to merge 1 commit into
JuliaGPU:mainfrom
napes:aot-device-intrinsics
Open

Make Metal intrinsics device-only#849
napes wants to merge 1 commit into
JuliaGPU:mainfrom
napes:aot-device-intrinsics

Conversation

@napes

@napes napes commented Jun 20, 2026

Copy link
Copy Markdown

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

  • Rebased onto latest JuliaGPU/Metal.jl:main at 224d0e29.
  • git merge-tree --write-tree upstream/main HEAD completed successfully, producing merge tree cfb1bf62cfd5171e8eeeac7f0e80850bf00fa866.
  • julia --project scripts/check_host_device_intrinsic_regression.jl passed from the repro environment with required failures: 0 and candidate leaks: 0.

Notes

The repro environment resolved Metal v1.10.0 from /Users/ian/Documents/Metal.jl and GPUCompiler v1.22.3 from JuliaGPU/GPUCompiler.jl#main.

@napes napes marked this pull request as ready for review June 20, 2026 18:56
@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.63%. Comparing base (224d0e2) to head (769c004).
⚠️ Report is 1 commits behind head on main.

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.
📢 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.

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