Closed therealbnut closed 2 years ago
If you use bytemuck
with the nightly_portable_simd feature then you can do this fairly easily.
In general, special transmutation related things are not as likely with the portable simd api so that there's not duplication with the eventual APIs from the safe-transmute project.
Thanks @Lokathor, I can also use code similar to what I posted. I was thinking this might be something very useful to integrate into the main package as it seems fairly core.
main package as it seems fairly core
@burrbull thanks, I’ll look into that and raise there if needed.
Sorry, I vaguely remembered plans for something more official, but couldn’t find it when googling and searching crates.io.
Oh, sorry, I didn't even realize that this is the packed_simd repo I just assumed it was the portable-simd repo XD
Hi,
I've noticed the aligned slice copy methods essentially internally cast the structure to a slice. I'd find it very useful for processing file data in a Simd structure to have read/write access to this slice, to avoid an intermediate copy.
I currently have to do this:
I'd like to do this:
Is there any reason you couldn't do something like this (although maybe without the
unsafe
code by using knowledge of the underlying data structures):