summaryrefslogtreecommitdiff
path: root/test/Main.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/Main.hs
parentff220bfb4c4c67f666a4701f2514d8de432f1e9a (diff)
Diffstat (limited to 'test/Main.hs')
-rw-r--r--test/Main.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/Main.hs b/test/Main.hs
new file mode 100644
index 0000000..19105dd
--- /dev/null
+++ b/test/Main.hs
@@ -0,0 +1,20 @@
+module Main where
+
+import qualified Data.Array.Accelerate as A
+import qualified Data.Array.Accelerate.Interpreter as I
+import System.Exit
+
+import qualified Data.Array.Accelerate.C as C
+
+import qualified Examples.Mandel as Mandel
+import Examples.Utils.PPM
+
+
+main :: IO ()
+main = do
+ let viewport = ((640, 480), (-0.5, 0.0), 3.0)
+ img = I.run1 Mandel.afun (A.fromList A.Z [(viewport, 200)])
+ case C.translateAcc "mandelkernel" Mandel.afun of
+ Left err -> die err
+ Right (code, _, _) -> writeFile "mandel-out.c" code
+ ppmWrite img "mandel.ppm"