AccelerateHS / AccelerateHS/accelerate

Clean up the internal AST

Open
#213 5 comments 0 reactions 1 assignee Claimed by @ivogabe View on GitHub
Dominant language
Haskell
Stars
1k
Forks
135
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.