source · imports gp: extensions/gpu/lib/Gpu.xtl extensions/gpu/lib/Gpu.xtlm; ac: libs/Accel/src/Accel.xtl; ck: work/xetal-extensions/extensions/clock/lib/Clock.xtl
gp:
ac:
ck:
a ← 512 512 r̲eshape (r̲ange 262144) ÷ 262144
cpu ← '{ m → m ᵃᶜm̲atmul m } ᶜᵏt̲ime a
gpu ← '{ m → m ᵍᵖp̲roduct m } ᶜᵏt̲ime a
x ← (r̲ange 1048576) ÷ 1048576
w ← 1048576 r̲eshape 1.0 -1.0
cpuE ← '{ v → v ᵃᶜp̲ipeline w } ᶜᵏt̲ime x
p ← "%x = input f64 [1048576]\n%w = input f64 [1048576]\n%xw = map mul %x %w\n%s = map add %x %xw\n%z = const f64 [] 0.0\n%r = map max %s %z\n%t = reduce add %r\noutput %t\n"
gpuE ← '{ v → l ← ᵍᵖl̲oad p◆ b1 ← 1 ᵍᵖb̲ind v◆ b2 ← 2 ᵍᵖb̲ind w◆ r ← ᵍᵖr̲un 0◆ ᵍᵖo̲utput 1 } ᶜᵏt̲ime x ⍝ lint: allow unused-binding