Skip to content

Commit

Permalink
Merge pull request #571 from robertknight/quantize-inline
Browse files Browse the repository at this point in the history
Add missing `#[inline(always)]` to `Quantize` SIMD op
  • Loading branch information
robertknight authored Feb 2, 2025
2 parents 7147f81 + a468b30 commit 7955534
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions rten-simd/src/arch/x86_64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl SimdInt for __m256i {
}

#[inline]
#[target_feature(enable = "avx2")]
unsafe fn saturating_cast_u8(self) -> impl Simd<Elem = u8> {
use std::arch::x86_64::{
__m128i, _mm256_castsi256_si128, _mm256_packus_epi16, _mm256_packus_epi32,
Expand Down
1 change: 1 addition & 0 deletions rten-vecmath/src/quantize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ impl<'s, 'd, To> Quantize<'s, 'd, To> {
impl<'d> SimdOp for Quantize<'_, 'd, u8> {
type Output = &'d mut [u8];

#[inline(always)]
unsafe fn eval<S: SimdFloat>(self) -> Self::Output {
let mut n = self.src.len();
let mut src_ptr = self.src.as_ptr();
Expand Down

0 comments on commit 7955534

Please sign in to comment.