Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SIMD vector length a runtime rather than compile-time constant #600

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

robertknight
Copy link
Owner

Make Simd::LEN an Option<usize> to represent the possibility that the vector length is unknown at compile time, but a fixed size at runtime, and add a Simd::len method which returns either the compile or runtime-constant size.

Runtime-determined SIMD vector types (eg. Arm SVE, RVV) are not currently supported in Rust, but the expectation is that they will be eventually 1. This change is made in the hope that it will make it easier to support such types in future.

Footnotes

  1. https://github.com/davidtwco/rfcs/blob/sized-hierarchy/text/3729-sized-hierarchy.md

Make `Simd::LEN` an `Option<usize>` to represent the possibility that the vector
length is unknown at compile time, but a fixed size at runtime, and add a
`Simd::len` method which returns either the compile or runtime-constant size.

Runtime-determined SIMD vector types (eg. Arm SVE, RVV) are not currently
supported in Rust, but the expectation is that they will be eventually [^1].
This change is made in the hope that it will make it easier to support such
types in future.

[^1]: https://github.com/davidtwco/rfcs/blob/sized-hierarchy/text/3729-sized-hierarchy.md
@robertknight robertknight merged commit 5adb14f into main Feb 16, 2025
2 checks passed
@robertknight robertknight deleted the simd-optional-len branch February 16, 2025 12:38
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