/src/xnnpack/build/cpuinfo-source/src/cache.c
Line | Count | Source |
1 | | #include <stddef.h> |
2 | | |
3 | | #include <cpuinfo.h> |
4 | | #include <cpuinfo/internal-api.h> |
5 | | |
6 | 1 | uint32_t cpuinfo_compute_max_cache_size(const struct cpuinfo_processor* processor) { |
7 | 1 | if (processor->cache.l4 != NULL) { |
8 | 0 | return processor->cache.l4->size; |
9 | 1 | } else if (processor->cache.l3 != NULL) { |
10 | 1 | return processor->cache.l3->size; |
11 | 1 | } else if (processor->cache.l2 != NULL) { |
12 | 0 | return processor->cache.l2->size; |
13 | 0 | } else if (processor->cache.l1d != NULL) { |
14 | 0 | return processor->cache.l1d->size; |
15 | 0 | } |
16 | 0 | return 0; |
17 | 1 | } |