mirror of
https://github.com/vllm-project/vllm.git
synced 2026-08-22 05:30:18 +00:00
[Bugfix][CPU] Fix macOS build: std::sqrt is not constexpr under libc++ (#50915)
Signed-off-by: harjoth <[email protected]>
This commit is contained in:
@@ -101,7 +101,7 @@ struct l2norm_kernel {
|
||||
using bVec = at::vec::Vectorized<scalar_t>;
|
||||
using fVec = at::vec::Vectorized<float>;
|
||||
constexpr int bVecSize = bVec::size();
|
||||
constexpr float scale = 1.f / std::sqrt(static_cast<float>(D));
|
||||
const float scale = 1.f / std::sqrt(static_cast<float>(D));
|
||||
|
||||
fVec sum_fvec0(0.f), sum_fvec1(0.f);
|
||||
int d = 0;
|
||||
@@ -155,7 +155,7 @@ struct l2norm_kernel<at::BFloat16, D, has_scale> {
|
||||
__m512bh va[COLS];
|
||||
__m512 vrscale;
|
||||
|
||||
constexpr float scale = 1.f / std::sqrt(D);
|
||||
const float scale = 1.f / std::sqrt(D);
|
||||
__m512 vscale = _mm512_set1_ps(scale);
|
||||
|
||||
// step 1: load input and do reduce with avx512-bf16
|
||||
|
||||
Reference in New Issue
Block a user