Skip to content

Commit e2d6008

Browse files
tiehexuebigPYJ1151
authored andcommitted
Cast return value to int64_t for cache size (#28814)
Signed-off-by: tiehexue <tiehexue@hotmail.com> Signed-off-by: jiang1.li <jiang1.li@intel.com>
1 parent fbc369c commit e2d6008

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

csrc/cpu/cpu_attn_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ class AttentionScheduler {
754754
return l2_cache_size >> 1; // use 50% of L2 cache
755755
}
756756
// Fallback if sysctlbyname fails
757-
return 128 * 1024 >> 1; // use 50% of 128KB
757+
return 128LL * 1024 >> 1; // use 50% of 128KB
758758
#else
759759
long l2_cache_size = sysconf(_SC_LEVEL2_CACHE_SIZE);
760760
TORCH_CHECK_NE(l2_cache_size, -1);

0 commit comments

Comments
 (0)