Skip to content

Add conversions for Simd from/to arrays of types convertible from/to Simd #461

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

programmerjake
Copy link
Member

@programmerjake
Copy link
Member Author

So, @calebzulawski @workingjubilee do you think having the conversions be fully generic over anything that implements Into is a good idea, or should we limit that to arrays, Simd and the platform-specific SIMD types? Is this good enough to merge?

@calebzulawski
Copy link
Member

The thing I'm not particularly liking is the dimension change preventing a nice generic implementation. Not that it means we shouldn't implement this, but is this conversion supported by bytemuck?

@programmerjake
Copy link
Member Author

programmerjake commented Jun 1, 2025

The thing I'm not particularly liking is the dimension change preventing a nice generic implementation.

yeah, but since generic const exprs isn't coming anytime soon, imo this is the best we can do.

Not that it means we shouldn't implement this, but is this conversion supported by bytemuck?

Simd is not supported by bytemuck 1.23.0 (latest)
turns out it actually is supported, you just need to enable the nightly_portable_simd feature that's not enabled by default on docs.rs.

@workingjubilee
Copy link
Member

This doesn't seem like quite the right solution.

@programmerjake
Copy link
Member Author

This doesn't seem like quite the right solution.

ok, so then do you have any better ideas, or can you be more specific? imo something like this would be quite useful, so we should have some better way (preferably safe) than just a manual mem::transmute

@calebzulawski
Copy link
Member

Maybe something that uses arrays as an intermediate and relies on optimization (since transmutes don't care about alignment, right?)

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.

3 participants