[commit: ghc] ghc-lwc2: Minor edits to spacing in ChameneosRedux (d88a816)

Sivaramakrishnan Krishnamoorthy Chandrasekaran t-sichan at microsoft.com
Sat Apr 27 04:22:46 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : ghc-lwc2

https://github.com/ghc/ghc/commit/d88a816c144db2a036ef64e7d119d61e223ff077

>---------------------------------------------------------------

commit d88a816c144db2a036ef64e7d119d61e223ff077
Author: KC Sivaramakrishnan <chandras at cs.purdue.edu>
Date:   Wed Apr 24 18:43:04 2013 -0400

    Minor edits to spacing in ChameneosRedux

>---------------------------------------------------------------

 tests/Benchmarks/ChameneosRedux/MVarList.hs        |  2 +-
 .../ChameneosRedux/chameneos-redux-lwc.hs          |  4 ++--
 .../ChameneosRedux/chameneos-redux-vanilla.hs      | 24 ++++++++++------------
 tests/Benchmarks/Sieve/Makefile                    |  2 +-
 4 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/tests/Benchmarks/ChameneosRedux/MVarList.hs b/tests/Benchmarks/ChameneosRedux/MVarList.hs
index f4299b2..76f398a 100644
--- a/tests/Benchmarks/ChameneosRedux/MVarList.hs
+++ b/tests/Benchmarks/ChameneosRedux/MVarList.hs
@@ -51,7 +51,7 @@ enque (Queue front back) e = Queue front $ e:back
 
 _INL_(deque)
 deque :: Queue a -> (Queue a, Maybe a)
-deque (Queue front back) =
+deque (Queue !front !back) =
   case front of
     [] -> (case reverse back of
             [] -> (emptyQueue, Nothing)
diff --git a/tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs b/tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs
index 6433897..d49cc41 100644
--- a/tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs
+++ b/tests/Benchmarks/ChameneosRedux/chameneos-redux-lwc.hs
@@ -77,8 +77,8 @@ run :: Int -> Int -> [Color] -> IO (IO ())
 run n cpu cs = do
   fs    <- replicateM (length cs) newEmptyMVar
   mpv   <- newMVar (Nobody n)
-  hole <- newIORef undefined
-  tk <- atomically $ newResumeToken
+  hole  <- newIORef undefined
+  tk    <- atomically $ newResumeToken
   withArrayLen cs $ \ n cols -> do
     zipWithM_ ((forkOn cpu .) . arrive mpv) fs (take n (iterate (`advancePtr` 1) cols))
     return $ do
diff --git a/tests/Benchmarks/ChameneosRedux/chameneos-redux-vanilla.hs b/tests/Benchmarks/ChameneosRedux/chameneos-redux-vanilla.hs
index fad8c87..593daa0 100644
--- a/tests/Benchmarks/ChameneosRedux/chameneos-redux-vanilla.hs
+++ b/tests/Benchmarks/ChameneosRedux/chameneos-redux-vanilla.hs
@@ -24,9 +24,9 @@ newtype Color = C Int deriving (Storable,Enum)
 #define B (C 0)
 
 instance Show Color where
-	show Y = "yellow"
-	show R = "red"
-	show B = "blue"
+  show Y = "yellow"
+  show R = "red"
+  show B = "blue"
 
 complement :: Color -> Color -> Color
 complement !a !b = case a of
@@ -48,11 +48,10 @@ arrive !mpv !finish !ch = do
                  -> do
                     putMVar mpv w
                     putMVar finish (t, b)
-  		Nobody q -> do
+                Nobody q -> do
                     putMVar mpv $ Somebody q ch waker
                     ch' <- takeMVar waker
                     go (t+1) $ inc ch' b
-
                 Somebody q ch' waker' -> do
                     c  <- peek ch
                     c' <- peek ch'
@@ -74,14 +73,13 @@ run n cpu cs = do
     fs    <- replicateM (length cs) newEmptyMVar
     mpv   <- newMVar (Nobody n)
     withArrayLen cs $ \ n cols -> do
-    	zipWithM_ ((forkOn cpu .) . arrive mpv) fs (take n (iterate (`advancePtr` 1) cols))
-
-    	return $ do
-	  putStrLn . map toLower . unwords . ([]:) . map show $ cs
-	  ns    <- mapM takeMVar fs
-	  putStr . map toLower . unlines $ [unwords [show n, showN b] | (n, b) <- ns]
-	  putStrLn . (" "++) . showN . sum . map fst $ ns
-	  putStrLn ""
+      zipWithM_ ((forkOn cpu .) . arrive mpv) fs (take n (iterate (`advancePtr` 1) cols))
+      return $ do
+        putStrLn . map toLower . unwords . ([]:) . map show $ cs
+        ns    <- mapM takeMVar fs
+        putStr . map toLower . unlines $ [unwords [show n, showN b] | (n, b) <- ns]
+        putStrLn . (" "++) . showN . sum . map fst $ ns
+        putStrLn ""
 
 main = do
     putStrLn . map toLower . unlines $
diff --git a/tests/Benchmarks/Sieve/Makefile b/tests/Benchmarks/Sieve/Makefile
index 48d9474..51934ea 100644
--- a/tests/Benchmarks/Sieve/Makefile
+++ b/tests/Benchmarks/Sieve/Makefile
@@ -3,6 +3,6 @@ TARGET := sieve-vanilla.bin sieve-lwc.bin
 include ../../config.mk
 
 TOP := ../../../
-GHC_OPTS_EXTRA=-XBangPatterns -O2 -threaded
+GHC_OPTS_EXTRA=-XBangPatterns -O2 -threaded -XCPP
 
 all: $(TARGET)





More information about the ghc-commits mailing list