/ concept-collection / math-webgpu-sandbox
Sign in
concept-collection / math-webgpu-sandbox
math-webgpu-sandbox / examples / logistic_ensemble.m
13 lines · 390 BCodeBlameHistory
02f2376Scale examples to 1-4 s of GPU work so tic/toc comparisons are meaningfulJeremy Magland 1% Two million logistic maps x <- r x (1 - x) iterated 4000 times in
2% lockstep (8 billion updates). The loop body compiles once and replays.
3n = 2000000;
4niter = 4000;
6x = rand(n, 1);
7tic;
10end
12fprintf('%.0f million map-updates/sec\n', niter*n/1e6/t);
13fprintf('mean x after %d iterations: %.4f\n', niter, mean(x));
moveopenescclose