AccelerateHS / AccelerateHS/accelerate

Clean up the internal AST

未关闭
#213 5 条评论 0 个 reaction 已指派 1 人 已被 @ivogabe 认领 在 GitHub 查看
主要语言
Haskell
星标
1k
派生
135
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。