AccelerateHS / AccelerateHS/accelerate

Clean up the internal AST

Aperta
#213 5 commenti 0 reazioni 1 assegnatario Rivendicata da @ivogabe Vedi su GitHub
Lingua principale
Haskell
Stelle
1k
Fork
135
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Accelerate's internal AST has accrued some redundant terms in the AST over its lifetime, which might be good to consolidate.
- `Replicate` and `Slice` are effectively moved to the scalar language via `IndexFull` and `IndexSlice` respectively. There may be an argument for leaving these forms in if we can optimise them into a `memcpy`, say, but typically we want them to be fused into other operations, hence the scalar varieties.
- `Transform` is the combination of `Map` and `Backpermute`. It could probably do with a better name as well. `Map` is probably good to keep as it is simpler to implement, and does not require multidimensional indices. Also `unzip*` is expressed in terms of `map` which makes it relatively easy for a backend to execute `unzipN` in constant time (although this is not currently done).
- `ZipWith` could be expressed in terms of `Generate`, which is what the fusion transform does, but maybe there are advantages to keeping it separate? Because of intersection semantics we can't do the same linear-indexing tricks as `Map`, and doesn't allow us to do `zipN` in constant time. Having a pathway to support constant time `zipN` might be good.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.