Skip to content

Commit

Permalink
work around rust analyzer error
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-quinones committed Jan 13, 2025
1 parent e16a893 commit 584774f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions faer/src/linalg/lu/full_pivoting/factor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn best_value<T: ComplexField, S: Simd>(
indices: T::SimdIndex<S>,
) -> (RealReg<T::SimdVec<S>>, T::SimdIndex<S>) {
let value = simd.abs1(value);
let is_better = simd.gt(value, best_value);
let is_better = (**simd).gt(value, best_value);
(
RealReg(simd.select(is_better, value.0, best_value.0)),
simd.iselect(is_better, indices, best_indices),
Expand All @@ -30,7 +30,7 @@ fn best_score<T: ComplexField, S: Simd>(
score: RealReg<T::SimdVec<S>>,
indices: T::SimdIndex<S>,
) -> (RealReg<T::SimdVec<S>>, T::SimdIndex<S>) {
let is_better = simd.gt(score, best_score);
let is_better = (**simd).gt(score, best_score);
(
RealReg(simd.select(is_better, score.0, best_score.0)),
simd.iselect(is_better, indices, best_indices),
Expand All @@ -47,7 +47,7 @@ fn best_score_2d<T: ComplexField, S: Simd>(
row: T::SimdIndex<S>,
col: T::SimdIndex<S>,
) -> (RealReg<T::SimdVec<S>>, T::SimdIndex<S>, T::SimdIndex<S>) {
let is_better = simd.gt(score, best_score);
let is_better = (**simd).gt(score, best_score);
(
RealReg(simd.select(is_better, score.0, best_score.0)),
simd.iselect(is_better, row, best_row),
Expand All @@ -66,7 +66,7 @@ fn reduce_2d<T: ComplexField, S: Simd>(
let best_val = simd.reduce_max_real(best_values);

let best_val_splat = simd.splat_real(&best_val);
let is_best = simd.ge(best_values, best_val_splat);
let is_best = (**simd).ge(best_values, best_val_splat);
let idx = simd.first_true_mask(is_best);

let best_row = bytemuck::cast_slice::<T::SimdIndex<S>, T::Index>(core::slice::from_ref(&best_row))[idx];
Expand Down
20 changes: 10 additions & 10 deletions faer/src/linalg/reductions/norm_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,30 @@ fn norm_max_simd<'N, T: ComplexField>(data: ColRef<'_, T, Dim<'N>, ContiguousFwd

if let Some(i0) = head {
let x0 = simd.abs_max(simd.read(data, i0));
acc0 = simd.max(acc0, x0);
acc0 = (*simd).max(acc0, x0);
}
for [i0, i1, i2, i3] in body4 {
let x0 = simd.abs_max(simd.read(data, i0));
let x1 = simd.abs_max(simd.read(data, i1));
let x2 = simd.abs_max(simd.read(data, i2));
let x3 = simd.abs_max(simd.read(data, i3));

acc0 = simd.max(acc0, x0);
acc1 = simd.max(acc1, x1);
acc2 = simd.max(acc2, x2);
acc3 = simd.max(acc3, x3);
acc0 = (*simd).max(acc0, x0);
acc1 = (*simd).max(acc1, x1);
acc2 = (*simd).max(acc2, x2);
acc3 = (*simd).max(acc3, x3);
}
for i0 in body1 {
let x0 = simd.abs_max(simd.read(data, i0));
acc0 = simd.max(acc0, x0);
acc0 = (*simd).max(acc0, x0);
}
if let Some(i0) = tail {
let x0 = simd.abs_max(simd.read(data, i0));
acc0 = simd.max(acc0, x0);
acc0 = (*simd).max(acc0, x0);
}
acc0 = simd.max(acc0, acc1);
acc2 = simd.max(acc2, acc3);
acc0 = simd.max(acc0, acc2);
acc0 = (*simd).max(acc0, acc1);
acc2 = (*simd).max(acc2, acc3);
acc0 = (*simd).max(acc0, acc2);

simd.reduce_max_real(acc0)
}
Expand Down

0 comments on commit 584774f

Please sign in to comment.