return hex
}
- function average (times) {
+ function average (times, effort) {
let count = times.length, sum = 0, reciprocals = 0, logarithms = 0, truncated = 0, min = 0xffff, max = 0, rate = 0
times.sort()
for (let i = 0; i < count; i++) {
max = Math.max(max, times[i])
if (count < 3 || (i > (count * 0.1) && i < (count * 0.9))) truncated += times[i]
}
+ const title = `NanoPow (WebGPU) | Dispatch: ${(0x100 * effort) ** 2} | Threads: ${8 * 8 * (0x100 * effort) ** 2}`
return {
- count: count,
- total: sum,
- rate: 1000 * count / (truncated || sum),
- min: min,
- max: max,
- arithmetic: sum / count,
- truncated: truncated / count,
- harmonic: count / reciprocals,
- geometric: Math.exp(logarithms / count)
+ [title]: {
+ count: count,
+ total: sum,
+ rate: 1000 * count / (truncated || sum),
+ min: min,
+ max: max,
+ arithmetic: sum / count,
+ truncated: truncated / count,
+ harmonic: count / reciprocals,
+ geometric: Math.exp(logarithms / count)
+ }
}
}
if (isOutputShown) document.getElementById('output').innerHTML += `${msg}<br/>`
}
document.getElementById('output').innerHTML += `<hr/>`
- document.getElementById('summary').innerHTML += `${JSON.stringify(average(times), null, '\t')}<br/>`
+ document.getElementById('summary').innerHTML += `${JSON.stringify(average(times, effort), null, '\t')}<br/>`
print(times)
document.getElementById('status').innerHTML = `TESTING COMPLETE<br/>`
console.log('%cTESTING COMPLETE', 'color:orange;font-weight:bold')