From e42bd8c2e3bfecdaf9c5a7ad99d7c7d7cb75a7b5 Mon Sep 17 00:00:00 2001 From: tiehexue Date: Tue, 18 Nov 2025 00:02:32 +0800 Subject: [PATCH] Cast return value to int64_t for cache size (#28814) Signed-off-by: tiehexue --- csrc/cpu/cpu_attn_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csrc/cpu/cpu_attn_impl.hpp b/csrc/cpu/cpu_attn_impl.hpp index 5de8a114b2b55..344296528b652 100644 --- a/csrc/cpu/cpu_attn_impl.hpp +++ b/csrc/cpu/cpu_attn_impl.hpp @@ -754,7 +754,7 @@ class AttentionScheduler { return l2_cache_size >> 1; // use 50% of L2 cache } // Fallback if sysctlbyname fails - return 128 * 1024 >> 1; // use 50% of 128KB + return 128LL * 1024 >> 1; // use 50% of 128KB #else long l2_cache_size = sysconf(_SC_LEVEL2_CACHE_SIZE); TORCH_CHECK_NE(l2_cache_size, -1);