e01ddf1MATLAB-syntax scripts on WebGPU: fused kernels, tic/toc timing, CPU comparisonJeremy Magland 1% One million logistic maps x <- r x (1 - x) iterated in lockstep.
2% The loop body compiles once; 500 iterations replay on the GPU.
3n = 1000000;
4r = 3.5 + 0.5*rand(n, 1);
5x = rand(n, 1);
6tic;
7for k = 1:500
8 x = r .* x .* (1 - x);
9end
10toc
11fprintf('mean x after 500 iterations: %.4f\n', mean(x));