AdamNiederer / faster

SIMD for humans
Mozilla Public License 2.0
1.56k stars 51 forks source link

From std::iter::Iterator to PackedIterator #8

Closed polyfloyd closed 2 years ago

polyfloyd commented 6 years ago

Hi!

I think that it would be great to be able to call into_simd_iter() on regular Iterators, e.g.:

iter::repeat(42.0)
    .into_simd_iter()
    // ...

This allows SIMD to be applied when buffering the data into a vector would be inefficient and provides better interop with std.

AdamNiederer commented 6 years ago

This sounds like a good idea! We won't be able to take advantage of vectorized loads, but we might be able to optimize that further once specialization lands.

bugabinga commented 6 years ago

Would this also apply to ranges? Those do not implement Iterator.

AdamNiederer commented 6 years ago

Hi all,

Unfortunately, I'm going to delay this to 0.5.0, where I plan to overhaul the iterator system and remove most (if not all) of the overhead associated with the current system. This is the highest priority item in 0.5.0, however, so it should be the next "big thing" to land.

Would this also apply to ranges? Those do not implement Iterator.

That should be possible. We can probably vectorize it as well.