ARM-software / ComputeLibrary

The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
MIT License
2.81k stars 774 forks source link

why L1_cache_size and L2_cache_size are constant value #1101

Closed dervon closed 3 months ago

dervon commented 5 months ago

Different cpu should have different L1_cache_size/L2_cache_size, and I can't find any code in ComputeLibrary that will update these values later.

https://github.com/ARM-software/ComputeLibrary/blob/f2eda6665c12d568e179f5b0e7a24ccdc0ac824d/src/core/CPP/CPPTypes.cpp#L37-L38

Thank you in advance.

morgolock commented 3 months ago

Hi @dervon

That's correct, we don't update these values at runtime. The cache size is used to calculate the block sizes and this only works correctly if the cache sizes are reported accurately. The calculated block sizes are not guaranteed to be correct and they will change for different devices based on other variables and not just cache size.

An additional complication is that these cache sizes are not easily discoverable in Linux (and can vary across CPUs in a big/little system).

Hope this helps