Skip to content

Commit 832df8d

Browse files
committed
Raise an error when L3 cannot be found in lscpu output
1 parent 8bd8d74 commit 832df8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/blosc2/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ def get_l3_cache_info():
11631163
instances = int(instances_str.split()[0])
11641164
return size, instances
11651165

1166-
return None, None
1166+
raise ValueError("L3 cache not found in lscpu output")
11671167

11681168

11691169
def linux_cache_size(cache_level: int, default_size: int) -> int:
@@ -1174,7 +1174,7 @@ def linux_cache_size(cache_level: int, default_size: int) -> int:
11741174
# but sysfs only reports the cache size for each complex, so better use lscpu, if available.
11751175
try:
11761176
l3_cache_size, l3_cache_instances = get_l3_cache_info()
1177-
# What comes next is an heuristic to guess the most appropriate L3 cache size.
1177+
# What comes next is a heuristic to guess the most appropriate L3 cache size.
11781178
# Essentially, this is the result of different experiments, mainly on AMD CPUs
11791179
# (in particular, Ryzen 9800X3D with 8 cores, and EPYC 9454P with 48 cores).
11801180
# For Intel, YMMV, but my guess is that they are not using the same CCX approach.

0 commit comments

Comments
 (0)