Closed ralfbiedert closed 6 years ago
I've noticed this as well. I'll have a fix ready in the next day or so.
Fixed in ec9af7c5c357296cd698a628bf490c1f9ddf1089 and 0.4.1
This still fails for
#[cfg(test)]
mod tests {
use faster::{IntoPackedRefIterator, IntoPackedZip, PackedZippedIterator, PackedIterator, Packed, f64s};
#[test]
fn test_faster_simd() {
let a = vec![ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
let b = vec![ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ];
let slice_a = &a[..];
let slice_b = &b[..];
let sum: f64 = (slice_a.simd_iter(), slice_b.simd_iter()).zip()
.simd_map((f64s::splat(0f64), f64s::splat(0f64)), |(a,b)| (a - b) * (a - b))
// If you comment the next line out it works
.simd_reduce(f64s::splat(0f64), f64s::splat(0f64), |a, v| a + v )
.sum();
}
}
That's currently by design, because the API doesnt provide a good way to express what happens when one iterator returns a full vector while another iterator doesn't. I might revisit this when I do the iterator overhaul, but slicing down the larger vector or using a FnMut closure will probably be faster than what I can do.
Hi,
When I try to run the following code:
I get:
I'm using faster
0.4
, and rust1.25.0-nightly (4e3901d35 2018-01-23)
and notarget-feature
. The same happens when I enabletarget-feature=+avx2
. Unfortunately I don't really understand the assertion, so please let me know if there is something broken with the way I use faster.