Skip to content

Commit

Permalink
Final changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cmhhelgeson committed Dec 4, 2023
1 parent 04360b6 commit ba7bba1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/sample/bitonicSort/bitonicCompute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn local_compare_and_swap(idx_before: u32, idx_after: u32) {
return;
}
// invoke_id goes from 0 to invocationsPerWorkgroup
// invoke_id goes from 0 to workgroupSize
fn get_flip_indices(invoke_id: u32, block_height: u32) -> vec2<u32> {
// Caculate index offset (i.e move indices into correct block)
let block_offset: u32 = ((2 * invoke_id) / block_height) * block_height;
Expand Down
4 changes: 2 additions & 2 deletions src/sample/bitonicSort/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,12 @@ SampleInitFactoryWebGPU(
);

const resetExecutionInformation = () => {
// The workgroup size is either elements / 2 or Invocation Constraint
// The workgroup size is either elements / 2 or Size Limit
workgroupSizeController.setValue(
Math.min(settings['Total Elements'] / 2, settings['Size Limit'])
);

// Dispatch a workgroup for every (Max Invocations * 2) elements
// Dispatch a workgroup for every (Size Limit * 2) elements
const workgroupsPerStep =
(settings['Total Elements'] - 1) / (settings['Size Limit'] * 2);

Expand Down

0 comments on commit ba7bba1

Please sign in to comment.