AccelerateHS / AccelerateHS/accelerate
Arbitrarily sized stencils
- Langage dominant
- Haskell
- Étoiles
- 1k
- Forks
- 135
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
```
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.