AccelerateHS / AccelerateHS/accelerate

Arbitrarily sized stencils

Đang mở
#426 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
new feature
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ả

It should be possible to implement stencils of arbitrary size, where the size may not be known until runtime. This would look something like:
```haskell
stencil'
:: (Shape sh, Elt a, Elt b)
=> Exp sh -> Boundary (Array sh a)
-> (Acc (Array sh a) -> Acc (Scalar b))
-> Acc (Array sh a)
-> Acc (Array sh b)
```
This would be used like the existing stencils, but instead of a (nested) tuple, the summary function passed an array to summarise.

As a motivating example, a Gaussian blur:
```haskell
gaussianBlur :: Exp DIM2 -> Acc (Array DIM2 Float) -> Acc (Array DIM2 Float)
gaussianBlur blurRegionSize = stencil' blurRegionSize (function $ const 0) goBlur
where
goBlur = sum . flatten . zipWith (*) gaussCoefficients
gaussCoefficients :: Acc (Array DIM2 Float) -- shape gaussCoefficients == blurRegionSize

```

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.