Skip to content

Commit 83f5d63

Browse files
ckoparkarulysses4ever
authored andcommitted
Edits
1 parent 2be3896 commit 83f5d63

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

gibbon-ghc-integration/examples/app/Main.hs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ main = do
5353
-- !fastn <- fastbench1 10
5454
-- print fastn
5555

56-
let size = 22
56+
let size = 25
5757
let iters = 9
58-
(res0, t0, t_all) <- bench bench1 size iters
59-
return (show res0, show t0, show t_all)
58+
(res0, t0, t_all_0) <- bench bench1 size iters
6059

61-
(res0, t0, t_all) <- bench fastbench1 size iters
62-
return (show res0, show t0, show t_all)
60+
(res1, t1, t_all_1) <- benchIO fastbench1 size iters
61+
62+
print (res0,t0)
63+
print (res1,t1)
6364
pure ()

gibbon-ghc-integration/examples/src/BinTree.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ liftbench1 n = sumTree_seq (mkTree_seq n)
5050

5151

5252
foreign import ccall unsafe "c_liftbench1"
53-
cfastbench1 :: CInt -> CInt
53+
cfastbench1 :: CInt -> IO CInt
5454

55-
fastbench1 :: Int -> Int
56-
fastbench1 x =
57-
let y = cfastbench1 (fromIntegral x)
58-
in fromIntegral y
55+
fastbench1 :: Int -> IO Int
56+
fastbench1 x = do
57+
y <- cfastbench1 (fromIntegral x)
58+
pure $ fromIntegral y
5959

6060
--------------------------------------------------------------------------------
6161

0 commit comments

Comments
 (0)