summaryrefslogtreecommitdiff
path: root/test/Examples/Test.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2021-10-10 19:55:59 +0200
committerTom Smeding <tom@tomsmeding.com>2021-10-10 19:55:59 +0200
commit1640830bf5dc0630481e698512064215eb3e8249 (patch)
tree229b5666508e1152b5fff77733e48539591af0ab /test/Examples/Test.hs
parentff220bfb4c4c67f666a4701f2514d8de432f1e9a (diff)
Diffstat (limited to 'test/Examples/Test.hs')
-rw-r--r--test/Examples/Test.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Examples/Test.hs b/test/Examples/Test.hs
new file mode 100644
index 0000000..f3df311
--- /dev/null
+++ b/test/Examples/Test.hs
@@ -0,0 +1,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)