AUTOMAP: How to do NumPy-style broadcasting in Futhark (but better)
AUTOMAP: How to do NumPy-style broadcasting in Futhark (but better)
futhark-lang.org AUTOMAP: How to do NumPy-style broadcasting in Futhark (but better)
A high-performance and high-level purely functional data-parallel array programming language that can execute on the GPU and CPU.
NumPy-style broadcasting = being able to write code like
[[1, 2, 3],
[4, 5, 6], + [10, 11, 12]
[7, 8, 9]]
and have it evaluate the same as
[[1, 2, 3],
map (map (+)) [4, 5, 6], (rep 3 [10, 11, 12])
[7, 8, 9]]
(which evaluates to [[11, 13, 15], [14, 16, 18], [18, 19, 21]]
).
numpy docs. Numpy and most other languages do this at runtime, which is typically easier. But Futhark is statically-typed, so the type of the result must be known at compile time, and this means the broadcasting must also be done at compile time.
0
comments