AccelerateHS / AccelerateHS/accelerate

Clean up the internal AST

Đang mở
#213 5 bình luận 0 reaction 1 người được giao Được @ivogabe nhận Xem trên GitHub
Ngôn ngữ chính
Haskell
Star
1k
Fork
135
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.