]> zoso.dev Git - nano-pow.git/commitdiff
Show API type in test page summary output.
authorChris Duncan <chris@zoso.dev>
Mon, 20 Jan 2025 22:26:04 +0000 (14:26 -0800)
committerChris Duncan <chris@zoso.dev>
Mon, 20 Jan 2025 22:26:04 +0000 (14:26 -0800)
test.html

index 74a3e7374019e396d8086adf0cd74a537c23ee53..1093dd198a170977a6ca55e1ecdbcb00337343cf 100644 (file)
--- a/test.html
+++ b/test.html
@@ -28,7 +28,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
                        return hex
                }
 
-               function average (times, effort) {
+               function average (times, type, 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++) {
@@ -39,7 +39,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
                                max = Math.max(max, times[i])
                                if (count < 3 || (i > (count * 0.1) && i < (count * 0.9))) truncated += times[i]
                        }
-                       const title = `NanoPow (WebGPU) | Effort: ${effort} | Dispatch: ${(0x100 * effort) ** 2} | Threads: ${8 * 8 * (0x100 * effort) ** 2}`
+                       const title = `NanoPow (${type}) | Effort: ${effort} | Dispatch: ${(0x100 * effort) ** 2} | Threads: ${8 * 8 * (0x100 * effort) ** 2}`
                        return {
                                [title]: {
                                        count: count,
@@ -98,7 +98,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
                                if (isOutputShown) document.getElementById('output').innerHTML += `${msg}<br/>`
                        }
                        document.getElementById('output').innerHTML += `<hr/>`
-                       document.getElementById('summary').innerHTML += `${JSON.stringify(average(times, effort), null, '\t')}<br/>`
+                       document.getElementById('summary').innerHTML += `${JSON.stringify(average(times, type, effort), null, '\t')}<br/>`
                        document.getElementById('status').innerHTML = `TESTING COMPLETE<br/>`
                        console.log('%cTESTING COMPLETE', 'color:orange;font-weight:bold')
                }