From fac8aac4cbf0b3cdcaf891a0bca94716121afb55 Mon Sep 17 00:00:00 2001 From: Jan Wassenberg Date: Mon, 22 Sep 2025 05:36:32 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 809975026 --- BUILD.bazel | 1 + gemma/gemma-inl.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index d5bac73..8b0dcde 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -559,6 +559,7 @@ cc_library( "//io", "//io:blob_store", "//paligemma:image", + "@highway//:bit_set", "@highway//:hwy", "@highway//:nanobenchmark", # timer "@highway//:profiler", diff --git a/gemma/gemma-inl.h b/gemma/gemma-inl.h index a7f1b01..669d7e7 100644 --- a/gemma/gemma-inl.h +++ b/gemma/gemma-inl.h @@ -107,8 +107,10 @@ static inline void Activation(ActivationType activation, const RowPtrsBF C1, } } -#else +#endif // GEMMA_FUSED_FFN +// Only used if !GEMMA_FUSED_FFN, but define anyway so that we can check +// using if constexpr rather than #if, which interferes with code folding. template HWY_NOINLINE void ActivationBatched( ActivationType activation, Mat1& c1, const Mat2* c2, ThreadingContext& ctx, @@ -131,8 +133,6 @@ HWY_NOINLINE void ActivationBatched( } } -#endif // GEMMA_FUSED_FFN - template HWY_NOINLINE void ResidualConnection(const MatPtrT& other, MatPtrT& HWY_RESTRICT x,