Skip to content

Commit

Permalink
align
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Nov 28, 2023
1 parent e150fde commit dbf1996
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { GPUTest } from '../../../gpu_test';
import { checkElementsPassPredicate } from '../../../util/check_contents.js';
import { align } from '../../../util/math.js';

/* All buffer sizes are counted in units of 4-byte words. */

Expand Down Expand Up @@ -275,12 +276,12 @@ export class MemoryModelTester {

// Combine 3 arrays into 1 buffer as we need to keep the number of storage buffers to 4 for compat.
const falseSharingAvoidanceQuantum = 4096;
const barrierSize = Math.max(bytesPerWord, falseSharingAvoidanceQuantum);
const scratchpadSize = Math.max(
const barrierSize = align(bytesPerWord, falseSharingAvoidanceQuantum);
const scratchpadSize = align(
this.params.scratchMemorySize * bytesPerWord,
falseSharingAvoidanceQuantum
);
const scratchMemoryLocationsSize = Math.max(
const scratchMemoryLocationsSize = align(
this.params.maxWorkgroups * bytesPerWord,
falseSharingAvoidanceQuantum
);
Expand Down

0 comments on commit dbf1996

Please sign in to comment.