rust-lang / rust-lang/portable-simd
"Free" dynamic dispatch for core SIMD?
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.1k
- Forks
- 108
- Avg merge
- 22h 53m
- Merged PRs (30d)
- 3
Description
Hi! I'm very excited by the work on portable/core simd. Thank you for all of your work :)
I was looking over the API, and I was thinking it should be possible to get "free" runtime dispatch with a proc macro on top of portable SIMD, which would make portability really easy!
I'm thinking something like (more of a sketch than concrete proposal):
#[runtime_dispatch(sse,avx,avx2)]
fn some_simd_fn(...) {
// uses portable simd API
}
This would generate code much like the example in the core::arch docs here: https://doc.rust-lang.org/core/arch/index.html#dynamic-cpu-feature-detection, where it would generate versions of the function for each target_feature, then make the actual main function dynamically dispatch to each implementation.
Anyway, I thought I'd open this and get your thoughts.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the portable/core SIMD API and the dynamic CPU feature detection example in the core::arch documentation. The issue is a sketch seeking feedback rather than a defined implementation task; done would require an agreed design and scope for runtime dispatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100