Skip to content

Commit 267c7a3

Browse files
committed
fix ci
1 parent f755429 commit 267c7a3

3 files changed

Lines changed: 8 additions & 21 deletions

File tree

crates/yscv-imgproc/src/tests/morphology.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,11 @@ fn binary_box_matches_generic_ones_kernel() {
422422
state = state
423423
.wrapping_mul(6364136223846793005)
424424
.wrapping_add(1442695040888963407);
425-
data.push(if (state >> 33) % 3 == 0 { 1.0f32 } else { 0.0 });
425+
data.push(if (state >> 33).is_multiple_of(3) {
426+
1.0f32
427+
} else {
428+
0.0
429+
});
426430
}
427431
let img = Tensor::from_vec(vec![h, w, 1], data).unwrap();
428432
for ksize in [1usize, 3, 5, 9] {

crates/yscv-kernels/src/ops/simd/activation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,9 +1210,9 @@ unsafe fn sigmoid_slice_neon(input: &[f32], output: &mut [f32]) {
12101210
let len = input.len();
12111211
let in_ptr = input.as_ptr();
12121212
let out_ptr = output.as_mut_ptr();
1213-
let one = vdupq_n_f32(1.0);
12141213
let mut i = 0usize;
12151214
unsafe {
1215+
let one = vdupq_n_f32(1.0);
12161216
while i + 16 <= len {
12171217
let x0 = vld1q_f32(in_ptr.add(i));
12181218
let x1 = vld1q_f32(in_ptr.add(i + 4));

crates/yscv-kernels/src/ops/simd/exp.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ use std::arch::x86_64::{
2525
};
2626
#[cfg(target_arch = "x86_64")]
2727
use std::arch::x86_64::{
28-
__m512, _mm512_add_epi32, _mm512_add_ps, _mm512_castsi512_ps, _mm512_cvtepi32_ps,
29-
_mm512_cvtps_epi32, _mm512_div_ps, _mm512_fmadd_ps, _mm512_loadu_ps, _mm512_max_ps,
30-
_mm512_min_ps, _mm512_mul_ps, _mm512_scalef_ps, _mm512_set1_epi32, _mm512_set1_ps,
28+
__m512, _mm512_add_ps, _mm512_cvtepi32_ps, _mm512_cvtps_epi32, _mm512_div_ps, _mm512_fmadd_ps,
29+
_mm512_loadu_ps, _mm512_max_ps, _mm512_min_ps, _mm512_mul_ps, _mm512_scalef_ps, _mm512_set1_ps,
3130
_mm512_storeu_ps, _mm512_sub_ps,
3231
};
3332

@@ -292,22 +291,6 @@ pub(crate) unsafe fn fast_exp_sigmoid_avx(x: __m256) -> __m256 {
292291
// AVX-512 fast-exp helper (16-wide)
293292
// ===========================================================================
294293

295-
/// Schraudolph 1999 bit-trick exp for AVX-512.
296-
#[cfg(target_arch = "x86_64")]
297-
#[allow(unsafe_code)]
298-
#[allow(unsafe_op_in_unsafe_fn)]
299-
#[target_feature(enable = "avx512f")]
300-
#[inline]
301-
pub(crate) unsafe fn fast_exp_bittrick_avx512(x: __m512) -> __m512 {
302-
let scale = _mm512_set1_ps(12102203.0);
303-
let offset = _mm512_set1_epi32(1065353216);
304-
let clamp_lo = _mm512_set1_ps(-87.0);
305-
let clamp_hi = _mm512_set1_ps(88.0);
306-
let x_clamped = _mm512_max_ps(_mm512_min_ps(x, clamp_hi), clamp_lo);
307-
let val = _mm512_cvtps_epi32(_mm512_mul_ps(x_clamped, scale));
308-
_mm512_castsi512_ps(_mm512_add_epi32(val, offset))
309-
}
310-
311294
/// Polynomial exp for AVX-512: same range reduction and coefficients as AVX.
312295
#[cfg(target_arch = "x86_64")]
313296
#[allow(unsafe_code)]

0 commit comments

Comments
 (0)