From: Chris Duncan Date: Sun, 5 Jan 2025 11:27:39 +0000 (-0800) Subject: Reintroduce workload variable to allow hardware to control workgroup size, considered... X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=2472f09e1126fdb638d678aa359e9e6d08704d33;p=libnemo.git Reintroduce workload variable to allow hardware to control workgroup size, considered most important control in that regard. --- diff --git a/src/lib/workers/powgpu.ts b/src/lib/workers/powgpu.ts index 61e8543..e3a8518 100644 --- a/src/lib/workers/powgpu.ts +++ b/src/lib/workers/powgpu.ts @@ -43,6 +43,8 @@ export class PowGpu extends WorkerInterface { }) } + static workload = 256 + // WebGPU Compute Shader static #shader = ` struct UBO { @@ -145,7 +147,7 @@ export class PowGpu extends WorkerInterface { * 8-byte work is split into two 4-byte u32. Low 4 bytes are random u32 from * UBO. High 4 bytes are the random value XOR'd with index of each thread. */ - @compute @workgroup_size(256) + @compute @workgroup_size(${this.workload}) fn main( @builtin(workgroup_id) workgroup_id: vec3, @builtin(local_invocation_id) local_id: vec3