| 100 | } |
| 101 | |
| 102 | float TuningResolver::ThresholdRatio() { |
| 103 | // Empirically (see :tune_tool) determined threshold to distinguish in-order |
| 104 | // Cortex-A53/A55 cores from out-of-order Cortex-A57/A73/A75/A76 cores. Based |
| 105 | // on these experimental results, which were obtained with much lower |
| 106 | // (kLoopIters=1000, kRepeats=1) so as to make them resilient to noise, we |
| 107 | // have: |
| 108 | // |
| 109 | // CPU core type | in/out of order | observed ratio |
| 110 | // --------------+-----------------+----------------------------------------- |
| 111 | // Cortex-A53 | in-order | 0.32 -- 0.329 |
| 112 | // Cortex-A55 | in-order | 0.319 -- 0.325 |
| 113 | // Cortex-A55r1 | in-order | 0.319 -- 0.325 |
| 114 | // Cortex-A57 | out-of-order | 0.99 -- 1.01 |
| 115 | // Cortex-A73 | out-of-order | 0.922 -- 0.927 |
| 116 | // Cortex-A75 | out-of-order | 0.921 -- 0.93 |
| 117 | // Cortex-A76 | out-of-order | 1 |
| 118 | // Kryo (pixel1) | out-of-order | 0.73 -- 0.76 |
| 119 | // |
| 120 | // Thus the allowable range for the threshold is [0.35 .. 0.70]. |
| 121 | // We pick a value closer to the upper bound because really any out-of-order |
| 122 | // CPU should by definition produce a ratio close to 1. |
| 123 | return 0.65f; |
| 124 | } |
| 125 | |
| 126 | Tuning TuningResolver::ResolveNow() { |
| 127 | const bool is_probably_inorder = EvalRatio() < ThresholdRatio(); |