/
concept-collection
/
math-webgpu-sandbox
Jump to
/
Appearance
Match my system
Paper
GitHub
Slate
Midnight
Terminal
Sign in
concept-collection
/
math-webgpu-sandbox
Code
Commits
Issues
0
Pull requests
0
Actions
Branches
1
Tags
0
Site
e01ddf1
Branches
main
math-webgpu-sandbox
/
examples
/
logistic_ensemble.m
11 lines · 296 B
Copy
Copied
Blame
History
Raw
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.
3
n =
1000000
;
4
r =
3.5
+
0.5
*rand(n,
1
);
5
x = rand(n,
1
);
6
tic;
7
for
k =
1
:
500
8
x = r .* x .* (
1
- x);
9
end
10
toc
11
fprintf(
'mean x after 500 iterations: %.4f\n'
, mean(x));
↑
↓
move
↵
open
esc
close