fix simd (#1709)
This commit is contained in:
parent
108c04a8d2
commit
210315da0f
@ -5,7 +5,7 @@ use alloc::{
|
|||||||
vec::Vec,
|
vec::Vec,
|
||||||
};
|
};
|
||||||
#[rustversion::nightly]
|
#[rustversion::nightly]
|
||||||
use core::simd::SimdOrd;
|
use core::simd::cmp::SimdOrd;
|
||||||
use core::{
|
use core::{
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
marker::PhantomData,
|
marker::PhantomData,
|
||||||
@ -547,20 +547,20 @@ where
|
|||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
let steps = size / VectorType::LANES;
|
let steps = size / VectorType::LEN;
|
||||||
let left = size % VectorType::LANES;
|
let left = size % VectorType::LEN;
|
||||||
|
|
||||||
if let Some(novelties) = self.novelties.as_mut() {
|
if let Some(novelties) = self.novelties.as_mut() {
|
||||||
novelties.clear();
|
novelties.clear();
|
||||||
for step in 0..steps {
|
for step in 0..steps {
|
||||||
let i = step * VectorType::LANES;
|
let i = step * VectorType::LEN;
|
||||||
let history = VectorType::from_slice(&history_map[i..]);
|
let history = VectorType::from_slice(&history_map[i..]);
|
||||||
let items = VectorType::from_slice(&map[i..]);
|
let items = VectorType::from_slice(&map[i..]);
|
||||||
|
|
||||||
if items.simd_max(history) != history {
|
if items.simd_max(history) != history {
|
||||||
interesting = true;
|
interesting = true;
|
||||||
unsafe {
|
unsafe {
|
||||||
for j in i..(i + VectorType::LANES) {
|
for j in i..(i + VectorType::LEN) {
|
||||||
let item = *map.get_unchecked(j);
|
let item = *map.get_unchecked(j);
|
||||||
if item > *history_map.get_unchecked(j) {
|
if item > *history_map.get_unchecked(j) {
|
||||||
novelties.push(j);
|
novelties.push(j);
|
||||||
@ -581,7 +581,7 @@ where
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for step in 0..steps {
|
for step in 0..steps {
|
||||||
let i = step * VectorType::LANES;
|
let i = step * VectorType::LEN;
|
||||||
let history = VectorType::from_slice(&history_map[i..]);
|
let history = VectorType::from_slice(&history_map[i..]);
|
||||||
let items = VectorType::from_slice(&map[i..]);
|
let items = VectorType::from_slice(&map[i..]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user