Changeset 5f6b2c2


Ignore:
Timestamp:
Oct 5, 2022, 5:20:18 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
0deeaad
Parents:
d1cd4c4
Message:

Fixed case where the measure time could be 0 and log2(0) is a problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/cluster.hfa

    rd1cd4c4 r5f6b2c2  
    3939
    4040// convert to log2 scale but using double
    41 static inline __readyQ_avg_t __to_readyQ_avg(unsigned long long intsc) { return log2(intsc); }
     41static inline __readyQ_avg_t __to_readyQ_avg(unsigned long long intsc) { if(unlikely(0 == intsc)) return 0.0; else return log2(intsc); }
    4242
    4343#define warn_large_before warnf( !strict || old_avg < 35.0, "Suspiciously large previous average: %'lf, %'ldms \n", old_avg, program()`ms )
     
    5656        uint64_t *rp = &ret;
    5757        double ret = *(volatile double *)rp;
    58         double c = 3e-100;
    5958        /* paranoid */ verify( ret == 0 || ret > 3e-100 );
    6059        return ret;
Note: See TracChangeset for help on using the changeset viewer.