High-performance computing, with much less code
news.mit.edu
news.mit.edu
> without requiring an extra DSL
Give or take some nitpicking about where a language extension stops and a DSL begins, those things are the same. The only question is the syntax. The key thing the referenced paper shows is a set of composable operations (extremely nice property to have in a language).
There are other solutions. E.g., Polly [0] is capable of creating the 6-loop tiled square matrix multiplication routine from the vanilla 3-loop implementation. Much like auto-vectorization though, there are limits. E.g., if changing the scheduling also requires a change in your data representation -- like AoSoA rather than AoS or SoA to fit collocated data into a cache line -- you'll have to manually write the scheduling code as well since a vanilla loop no longer indexes the right things.
e.g. for the loop reordering example [1] in C you could just, well, manually reorder the loops; and the simple loop would autovectorize to AVX2 just fine.
The things that are messy-to-impossible to achieve in current traditional compilers are things where the compiler thinks it does a smart transformation, but it ends up making things worse.
[1]: https://github.com/exo-lang/exo/tree/main/examples/avx2_matm...
Add the ability to do point-wise arithmetic on C++ vectors By implementing operator+ and such.
Let’s compute A = (B + C) * D
The addition result is stored in a temporary vector and then processed again for the pointwise multiplication.
It would have been far better to avoid the temporary object (and associated memory allocation + cache pressure) and compute everything at once before moving the next index.
That becomes ridiculously non trivial to do ergonomically in C++ without extensive template meta programming —- with little thanks to the compiler.
I suspect One might even be able to argue with that C/C++ semantics in terms of sequence points and such very well might even forbid a mythical compiler to optimize and reorder function calls across loops and such.
Of course, the juicy arithmetic goes far beyond pointwise operations too…
Yeah, HPC is still the domain of humans for the time being.