summaryrefslogtreecommitdiff
path: root/test/Examples/Test.hs
blob: f3df31173568ff185be93d399b82e5ca8f5a3670 (plain)
1
2
3
4
5
6
7
8
9
10
module Examples.Test (afun) where

import Data.Array.Accelerate


afun :: Acc (Matrix Int, Vector (Int, Int))
     -> Acc (Matrix Int)
afun (T2 a b) = generate (I2 2 3) (\(I2 i j) ->
                  let T2 x y = b ! I1 i
                  in i * j + a ! I2 i j + x * y)