Unverified Commit e42bd8c2 authored by tiehexue's avatar tiehexue Committed by GitHub
Browse files

Cast return value to int64_t for cache size (#28814)


Signed-off-by: default avatartiehexue <tiehexue@hotmail.com>
parent 7f064491
...@@ -754,7 +754,7 @@ class AttentionScheduler { ...@@ -754,7 +754,7 @@ class AttentionScheduler {
return l2_cache_size >> 1; // use 50% of L2 cache return l2_cache_size >> 1; // use 50% of L2 cache
} }
// Fallback if sysctlbyname fails // Fallback if sysctlbyname fails
return 128 * 1024 >> 1; // use 50% of 128KB return 128LL * 1024 >> 1; // use 50% of 128KB
#else #else
long l2_cache_size = sysconf(_SC_LEVEL2_CACHE_SIZE); long l2_cache_size = sysconf(_SC_LEVEL2_CACHE_SIZE);
TORCH_CHECK_NE(l2_cache_size, -1); TORCH_CHECK_NE(l2_cache_size, -1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment