programextensions/blender/demos/matmul-fly.xtl

Blender, 7: a 512 x 512 matrix product as a 3D construct, a fly-through, arrays to video. A on the left wall, B on the ceiling, C on the front wall, every item a cell colored by its value; the camera starts far out (the whole cube: 134 million multiply-adds), flies to one work-group's 16 by 16 tile, then one work-item -- a row of A times a column of B, 512 products added into one item of C -- and back out while C fills in, a work-group at a time. The product is X_eTaL-gpu's Accel ac:m_atmul; every place, color and time is an array worked out in X_eTaL (demos/MatmulFly.xtl); Video.xtl writes them into the script Blender runs. Explained in docs/literate/matmul.org. Run: just demo blender matmul-fly (several minutes: 541 frames)

source · imports bl: extensions/blender/lib/Blender.xtl; bp: extensions/blender/lib/Bpy.xtl; vd: extensions/blender/lib/Video.xtl; mf: extensions/blender/demos/MatmulFly.xtl

script : Char

value · line 20
script ← ((1920, 1080, 512) ᵐᶠs̲cene 0) c̲at ((1.0 6.0 8.5 11.5 16.5, "matmul-fly") ᵛᵈs̲tills 0) c̲at (ᵛᵈr̲ender "matmul-fly.mp4") c̲at ᵛᵈreport
Used in: _

_ : Int

function · line 21
_ ← "work/explain/run.py" ᵇˡw̲rite! ᵇᵖlauncher

_ : Int

function · line 22
_ ← "work/explain/matmul-fly.py" ᵇˡw̲rite! script

r : Char

value · line 24
r ← "work/explain/run.py" ᵇˡr̲un! "work/explain/matmul-fly.py work/explain/out"
Used in: lines

lines : Box Char

value · line 26
lines ← (n̲ot r = f̲irst "\n") p̲artition r