This commit is contained in:
Dongjia "toka" Zhang 2023-12-03 16:19:12 +01:00 committed by GitHub
parent 108c04a8d2
commit 210315da0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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..]);