Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Poking at mandel.. its not ready

  • Loading branch information...
commit e886ed0e3fba22e9c156457df550ed70d9d02273 1 parent a11d2dd
@rrnewton rrnewton authored
View
44 accelerate/mandelbrot/Main.hs
@@ -1,44 +0,0 @@
---
--- A Mandelbrot set generator.
--- Originally submitted by Simon Marlow as part of Issue #49.
---
-
-import World
-import Config
-
-import Data.Label
-import Control.Monad
-import Foreign.Ptr
-import Foreign.ForeignPtr
-import System.IO.Unsafe
-import System.Environment ( getArgs, withArgs )
-import Criterion ( bench, whnf, runBenchmark )
-import Criterion.Monad ( withConfig )
-import Criterion.Analysis ( analyseMean )
-import Criterion.Environment ( measureEnvironment )
-import Data.Array.Accelerate.Array.Data ( ptrsOfArrayData )
-import Data.Array.Accelerate.Array.Sugar ( Array(..) )
-
-import Prelude as P
-import Data.Array.Accelerate as A hiding ( size )
-
-
--- Main ------------------------------------------------------------------------
-main :: IO ()
-main
- = do
- (config, critConf, nops) <- processArgs =<< getArgs
-
- let world = initialWorld config view
- view = (-0.25, -1.0, 0.0, -0.75)
- force arr = indexArray arr (Z:.0:.0) `seq` arr
-
- mandel = do
- mean <- withConfig critConf $ measureEnvironment >>= flip runBenchmark (whnf (force . renderWorld) world) >>= flip analyseMean 100
- putStrLn $ "SELFTIMED: " ++ show mean
-
- unless (P.null nops) $
- putStrLn $ "Warning: unrecognized options: " ++ show nops
-
- mandel
-
View
8 accelerate/mandelbrot/Config.hs → accelerate/mandelbrot/common/Config.hs
@@ -8,8 +8,8 @@ module Config (
) where
-import qualified Criterion.Main as Crit
-import qualified Criterion.Config as Crit
+-- import qualified Criterion.Main as Crit
+-- import qualified Criterion.Config as Crit
import Data.Label
import System.Exit
import System.Console.GetOpt (OptDescr(..), ArgDescr(..), ArgOrder(Permute), getOpt', usageInfo)
@@ -64,7 +64,7 @@ options =
-- | Two levels of argument parsing -- ours and criterions.
-processArgs :: [String] -> IO (Options, Crit.Config, [String])
+processArgs :: [String] -> IO (Options, (), [String])
processArgs argv =
case getOpt' Permute options argv of
(o,_,n,[]) -> do -- Pass unrecognized options onward:
@@ -75,7 +75,7 @@ processArgs argv =
(_,_,_,err) -> error (helpMsg err)
where
helpMsg err = concat err ++ usageInfo header options ++
- usageInfo "\nGeneric criterion options:" Crit.defaultOptions
+ usageInfo "\nGeneric criterion options:" [] -- Crit.defaultOptions
header = unlines
[ "accelerate-mandelbrot (c) [2011..2012] The Accelerate Team"
, ""
View
47 accelerate/mandelbrot/common/Main.hs
@@ -0,0 +1,47 @@
+--
+-- A Mandelbrot set generator.
+-- Originally submitted by Simon Marlow as part of Issue #49.
+--
+
+-- import World
+import qualified Mandel
+-- import Config
+
+import Data.Label
+import Control.Monad
+import Foreign.Ptr
+import Foreign.ForeignPtr
+import System.IO.Unsafe
+import System.Environment ( getArgs, withArgs )
+-- import Criterion ( bench, whnf, runBenchmark )
+-- import Criterion.Monad ( withConfig )
+-- import Criterion.Analysis ( analyseMean )
+-- import Criterion.Environment ( measureEnvironment )
+import Data.Array.Accelerate.Array.Data ( ptrsOfArrayData )
+import Data.Array.Accelerate.Array.Sugar ( Array(..) )
+
+import Prelude as P
+import Data.Array.Accelerate as A hiding ( size )
+
+
+-- Main ------------------------------------------------------------------------
+main :: IO ()
+main
+ = do
+ -- (config, critConf, nops) <- processArgs =<< getArgs
+ -- let world = initialWorld config view
+
+ -- view = (-0.25, -1.0, 0.0, -0.75)
+ -- force arr = indexArray arr (Z:.0:.0) `seq` arr
+
+ -- mandel = do
+ -- mean <- withConfig critConf $ measureEnvironment >>=
+ -- flip runBenchmark (whnf (force . renderWorld) world) >>=
+ -- flip analyseMean 100
+ -- putStrLn $ "SELFTIMED: " ++ show mean
+
+ -- unless (P.null nops) $
+ -- putStrLn $ "Warning: unrecognized options: " ++ show nops
+
+ -- mandel
+ return ()
View
2  accelerate/mandelbrot/Mandel.hs → accelerate/mandelbrot/common/Mandel.hs
@@ -15,7 +15,7 @@ module Mandel (
import Prelude as P
import Data.Array.Accelerate as A hiding ( size )
-import Data.Array.Accelerate.IO as A
+-- import Data.Array.Accelerate.IO as A
-- Types -----------------------------------------------------------------------
View
0  accelerate/mandelbrot/World.hs → accelerate/mandelbrot/common/World.hs
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.