[v7,32/32] ipa: libipa: lsc: Specialize Interpolator for uint8_t
diff mbox series

Message ID 20260805-libipa-algorithms-v7-32-7425b5b795d4@ideasonboard.com
State New
Headers show
Series
  • ipa: libipa: Introduce libipa algorithms
Related show

Commit Message

Jacopo Mondi Aug. 5, 2026, 4:13 p.m. UTC
Specialize Interpolator<>::interpolate() for uint8_t register size.

Some platforms (Mali, Simple) use an 8 bit register size. Provide
a specialization for the that type of Interpolator<>::interpolate().

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 src/ipa/libipa/lsc.cpp | 11 +++++++++++
 src/ipa/libipa/lsc.h   |  7 +++++++
 2 files changed, 18 insertions(+)

Comments

Kieran Bingham Aug. 5, 2026, 5:22 p.m. UTC | #1
Quoting Jacopo Mondi (2026-08-05 17:13:14)
> Specialize Interpolator<>::interpolate() for uint8_t register size.
> 
> Some platforms (Mali, Simple) use an 8 bit register size. Provide
> a specialization for the that type of Interpolator<>::interpolate().

I look forward to Barnabas or Laurent checking this one, but I won't
block it so:


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> ---
>  src/ipa/libipa/lsc.cpp | 11 +++++++++++
>  src/ipa/libipa/lsc.h   |  7 +++++++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/src/ipa/libipa/lsc.cpp b/src/ipa/libipa/lsc.cpp
> index a8b89bcedf57..cf9ea6e68c73 100644
> --- a/src/ipa/libipa/lsc.cpp
> +++ b/src/ipa/libipa/lsc.cpp
> @@ -102,6 +102,17 @@ void Interpolator<lsc::Components<uint16_t>>::
>         for (auto const &[k, v] : a)
>                 interpolateVector(v, b.at(k), dest[k], lambda);
>  }
> +
> +template<>
> +void Interpolator<lsc::Components<uint8_t>>::
> +       interpolate(const lsc::Components<uint8_t> &a,
> +                   const lsc::Components<uint8_t> &b,
> +                   lsc::Components<uint8_t> &dest,
> +                   double lambda)
> +{
> +       for (auto const &[k, v] : a)
> +               interpolateVector(v, b.at(k), dest[k], lambda);
> +}
>  #endif
>  
>  /**
> diff --git a/src/ipa/libipa/lsc.h b/src/ipa/libipa/lsc.h
> index 30330f284013..17d5a4a141c1 100644
> --- a/src/ipa/libipa/lsc.h
> +++ b/src/ipa/libipa/lsc.h
> @@ -48,6 +48,13 @@ void Interpolator<lsc::Components<uint16_t>>::
>                     const lsc::Components<uint16_t> &b,
>                     lsc::Components<uint16_t> &dest,
>                     double lambda);
> +
> +template<>
> +void Interpolator<lsc::Components<uint8_t>>::
> +       interpolate(const lsc::Components<uint8_t> &a,
> +                   const lsc::Components<uint8_t> &b,
> +                   lsc::Components<uint8_t> &dest,
> +                   double lambda);
>  #endif /* __DOXYGEN__ */
>  
>  class LscAlgorithmBase
> 
> -- 
> 2.54.0
>

Patch
diff mbox series

diff --git a/src/ipa/libipa/lsc.cpp b/src/ipa/libipa/lsc.cpp
index a8b89bcedf57..cf9ea6e68c73 100644
--- a/src/ipa/libipa/lsc.cpp
+++ b/src/ipa/libipa/lsc.cpp
@@ -102,6 +102,17 @@  void Interpolator<lsc::Components<uint16_t>>::
 	for (auto const &[k, v] : a)
 		interpolateVector(v, b.at(k), dest[k], lambda);
 }
+
+template<>
+void Interpolator<lsc::Components<uint8_t>>::
+	interpolate(const lsc::Components<uint8_t> &a,
+		    const lsc::Components<uint8_t> &b,
+		    lsc::Components<uint8_t> &dest,
+		    double lambda)
+{
+	for (auto const &[k, v] : a)
+		interpolateVector(v, b.at(k), dest[k], lambda);
+}
 #endif
 
 /**
diff --git a/src/ipa/libipa/lsc.h b/src/ipa/libipa/lsc.h
index 30330f284013..17d5a4a141c1 100644
--- a/src/ipa/libipa/lsc.h
+++ b/src/ipa/libipa/lsc.h
@@ -48,6 +48,13 @@  void Interpolator<lsc::Components<uint16_t>>::
 		    const lsc::Components<uint16_t> &b,
 		    lsc::Components<uint16_t> &dest,
 		    double lambda);
+
+template<>
+void Interpolator<lsc::Components<uint8_t>>::
+	interpolate(const lsc::Components<uint8_t> &a,
+		    const lsc::Components<uint8_t> &b,
+		    lsc::Components<uint8_t> &dest,
+		    double lambda);
 #endif /* __DOXYGEN__ */
 
 class LscAlgorithmBase