AccelerateHS / AccelerateHS/accelerate
Arbitrarily sized stencils
- 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á.