(
tileSize: number[], shape: number[])
| 25 | }; |
| 26 | |
| 27 | export function tilesFitEvenlyIntoShape( |
| 28 | tileSize: number[], shape: number[]): boolean { |
| 29 | if (tileSize.length !== shape.length) { |
| 30 | throw new Error( |
| 31 | `Cannot compute whether rank ${tileSize.length}` + |
| 32 | ` tiles fit evenly into rank ${shape.length} shape` + |
| 33 | ` - ranks must match.`); |
| 34 | } |
| 35 | return shape.every( |
| 36 | (dim: number, dimIdx: number) => dim % tileSize[dimIdx] === 0); |
| 37 | } |
| 38 | |
| 39 | // Computes dispatch geometry based on layout of output dimensions and |
| 40 | // workgroupSize. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…