sourcelibs/Accel/demos/matmul.xtl
1⍝!/usr/bin/env xetal
2⍝ Inner products: a matrix times a matrix, a matrix times a vector, a
3⍝ vector times a matrix, on Ints and Floats; every result item a sum of
4⍝ products. Run with "just demo-lib Accel matmul".
5ᵃᶜ⁼u̲se< "Accel"
6a ← 3 4 r̲eshape r̲ange 12
7b ← 4 2 r̲eshape 1 0 0 1 1 1 2 -1
8a ᵃᶜm̲atmul b
9a ᵃᶜm̲atmul 1 -1 1 -1
101 2 3 ᵃᶜm̲atmul a
11f ← (3 4 r̲eshape r̲ange 12) ÷ 4
12g ← (4 3 r̲eshape r̲ange 12) ÷ 8
13f ᵃᶜm̲atmul g