Skip to content

Commit

Permalink
let's get rid of wgSize
Browse files Browse the repository at this point in the history
  • Loading branch information
jowens committed Oct 9, 2024
1 parent 6de8b3f commit 1d97380
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions timing-mre.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,16 @@
const memcpyModule = device.createShaderModule({
label: "copy large chunk of memory from memSrc to memDest",
code: /* wgsl */ `
override wgSize: u32 = 1;
/* output */
@group(0) @binding(0) var<storage, read_write> memDest: array<u32>;
/* input */
@group(0) @binding(1) var<storage, read> memSrc: array<u32>;
@compute @workgroup_size(wgSize) fn memcpyKernel(
@compute @workgroup_size(${workgroupSize}) fn memcpyKernel(
@builtin(global_invocation_id) id: vec3u,
@builtin(num_workgroups) nwg: vec3u,
@builtin(workgroup_id) wgid: vec3u) {
let i = id.y * nwg.x * wgSize + id.x;
let i = id.y * nwg.x * ${workgroupSize} + id.x;
memDest[i] = memSrc[i] + 1;
}
`,
Expand All @@ -198,9 +197,6 @@
layout: "auto",
compute: {
module: memcpyModule,
constants: {
wgSize: workgroupSize,
},
},
});

Expand Down

0 comments on commit 1d97380

Please sign in to comment.