| | 262 | == Data Parallel Haskell ([http://www.haskell.org/haskellwiki/GHC/Data_Parallel_Haskell DPH]) layer == |
| | 263 | |
| | 264 | In DPH, we will use the new SIMD instructions by suitably modifying the definition of the lifted versions of arithmetic and other operations that we would like to accelerate. These lifted operations are defined in the `dph-common` package and made accessible to the vectoriser via [wiki:DataParallel/VectPragma VECTORISE pragmas]. Many of them currently use `VECTORISE SCALAR` pragmas, such as |
| | 265 | {{{ |
| | 266 | (+) :: Int -> Int -> Int |
| | 267 | (+) = (P.+) |
| | 268 | {-# VECTORISE SCALAR (+) #-} |
| | 269 | }}} |
| | 270 | We could define them more verbosely using a plain `VECTORISE` pragma, but might instead like to extend `VECTORISE SCALAR` or introduce a variant. |
| | 271 | |
| | 272 | '''NB:''' The use of SIMD instructions interferes with vectorisation avoidance for scalar subcomputations. Code that avoids vectorisation also avoids the use of SIMD instructions. We would like to use SIMD instructions, but still avoid full-scale vectorisation. This should be possible, but it is not immediately clear how to realise it (elegantly). |
| | 273 | |