MCPcopy Index your code
hub / github.com/gpujs/gpu.js / randomMatrix

Function randomMatrix

test/benchmark.js:12–21  ·  view source on GitHub ↗
(width, height)

Source from the content-addressed store, hash-verified

10const a = randomMatrix(size, size);
11const b = randomMatrix(size, size);
12function randomMatrix(width, height) {
13 const matrix = new Array(height);
14 for (let y = 0; y < height; y++) {
15 const row = matrix[y] = new Float32Array(width);
16 for (let x = 0; x < width; x++) {
17 row[x] = Math.random();
18 }
19 }
20 return matrix;
21}
22
23const gpuKernel = gpu
24 .createKernel(function(a, b) {

Callers 1

benchmark.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…