Skip to content

Commit fdf177d

Browse files
Highwaycopybara-github
authored andcommitted
hwy-contrib/thread_pool: Replace size check assert with skip.
PiperOrigin-RevId: 716663095
1 parent 7cccd1b commit fdf177d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

hwy/contrib/thread_pool/topology.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,9 @@ bool InitCachesWin(Caches& caches) {
10141014
if (cr.Type != CacheUnified && cr.Type != CacheData) return;
10151015
if (1 <= cr.Level && cr.Level <= 3) {
10161016
Cache& c = caches[cr.Level];
1017-
HWY_ASSERT(c.size_kib == 0); // not set yet
1017+
// If the size is non-zero then we (probably) have already detected this
1018+
// cache and can skip the CR.
1019+
if (c.size_kib > 0) return;
10181020
c.size_kib = static_cast<uint32_t>(DivByFactor(cr.CacheSize, 1024));
10191021
c.bytes_per_line = static_cast<uint16_t>(cr.LineSize);
10201022
c.associativity = (cr.Associativity == CACHE_FULLY_ASSOCIATIVE)

0 commit comments

Comments
 (0)