Skip to content

Commit

Permalink
hwy-contrib/thread_pool: Replace size check assert with skip.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 716663095
  • Loading branch information
Highway authored and copybara-github committed Jan 17, 2025
1 parent 7cccd1b commit fdf177d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hwy/contrib/thread_pool/topology.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,9 @@ bool InitCachesWin(Caches& caches) {
if (cr.Type != CacheUnified && cr.Type != CacheData) return;
if (1 <= cr.Level && cr.Level <= 3) {
Cache& c = caches[cr.Level];
HWY_ASSERT(c.size_kib == 0); // not set yet
// If the size is non-zero then we (probably) have already detected this
// cache and can skip the CR.
if (c.size_kib > 0) return;
c.size_kib = static_cast<uint32_t>(DivByFactor(cr.CacheSize, 1024));
c.bytes_per_line = static_cast<uint16_t>(cr.LineSize);
c.associativity = (cr.Associativity == CACHE_FULLY_ASSOCIATIVE)
Expand Down

0 comments on commit fdf177d

Please sign in to comment.