AccelerateHS / AccelerateHS/accelerate

Arbitrarily sized stencils

未关闭
#426 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
new feature
主要语言
Haskell
星标
1k
派生
135
PR 合并指标
30 天内没有已合并 PR

描述

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

```

贡献指南

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

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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