summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>2011-06-19 11:52:46 +1000
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>2011-06-19 11:52:46 +1000
commit7c4d3ade472bcdbd631b1e0c4a4ebf92ef33440b (patch)
tree436a3286315ad79300f7d361a11f168cd2d3d5a4 /testsuite
parent075655b71037d9ad1a26e44ad644695dd21ab26f (diff)
downloadhaskell-7c4d3ade472bcdbd631b1e0c4a4ebf92ef33440b.tar.gz
Adapt DPH tests to recent changes in the DPH libraries.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/.gitignore2
-rw-r--r--testsuite/tests/ghc-regress/dph/diophantine/DiophantineVect.hs51
-rw-r--r--testsuite/tests/ghc-regress/dph/dotp/DotPVect.hs2
-rw-r--r--testsuite/tests/ghc-regress/dph/primespj/PrimesVect.hs2
-rw-r--r--testsuite/tests/ghc-regress/dph/primespj/dph-primespj.T1
-rw-r--r--testsuite/tests/ghc-regress/dph/quickhull/QuickHullVect.hs2
-rw-r--r--testsuite/tests/ghc-regress/dph/quickhull/Types.hs2
-rw-r--r--testsuite/tests/ghc-regress/dph/quickhull/dph-quickhull.T1
-rw-r--r--testsuite/tests/ghc-regress/dph/smvm/SMVMVect.hs2
-rw-r--r--testsuite/tests/ghc-regress/dph/words/WordsVect.hs2
10 files changed, 37 insertions, 30 deletions
diff --git a/testsuite/.gitignore b/testsuite/.gitignore
index fa0feac6a1..58e5cf3f06 100644
--- a/testsuite/.gitignore
+++ b/testsuite/.gitignore
@@ -101,3 +101,5 @@ tests/ghc-regress/typecheck/should_fail/T3468.o-boot
timeout/calibrate.out
timeout/install-inplace/
timeout/dist/
+
+/tests/ghc-regress/dph/dotp/dph-dotp-fast \ No newline at end of file
diff --git a/testsuite/tests/ghc-regress/dph/diophantine/DiophantineVect.hs b/testsuite/tests/ghc-regress/dph/diophantine/DiophantineVect.hs
index e76e19abb0..bef6694b3d 100644
--- a/testsuite/tests/ghc-regress/dph/diophantine/DiophantineVect.hs
+++ b/testsuite/tests/ghc-regress/dph/diophantine/DiophantineVect.hs
@@ -2,30 +2,37 @@
{-# OPTIONS -fvectorise -XParallelListComp #-}
module DiophantineVect (solution3) where
-import Data.Array.Parallel.Prelude
+import Data.Array.Parallel
import Data.Array.Parallel.Prelude.Int
import qualified Prelude as P
-solution3
- = let pow x i = productP (replicateP i x)
- primes = [: 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73 :]
- sumpri xx = productP [: pow p x | p <- primes | x <- xx :]
- distinct xx = productP [: x + 1 | x <- xx :]
-
- series :: [:Int:] -> Int -> [:[:Int:]:]
- series xs n
- | n == 1 = [: [: 0 :] :]
- | otherwise = [: [: x :] +:+ ps
- | x <- xs
- , ps <- series (enumFromToP 0 x) (n-1) :]
-
- prob x y
- = let xx = [: (sumpri m ,m)
- | m <- series (enumFromToP 1 3) x
- , distinct [: x * 2 | x <- m :] > y :]
- i = minIndexP [: a | (a, b) <- xx :]
- in xx !: i
-
- in prob 7 2000
+solution3'
+ = let
+ pow x i = productP (replicateP i x)
+ primes = [: 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73 :]
+ sumpri xx = productP [: pow p x | p <- primes | x <- xx :]
+ distinct xx = productP [: x + 1 | x <- xx :]
+
+ series :: [:Int:] -> Int -> [:[:Int:]:]
+ series xs n
+ | n == 1 = [: [: 0 :] :]
+ | otherwise = [: [: x :] +:+ ps
+ | x <- xs
+ , ps <- series (enumFromToP 0 x) (n-1) :]
+
+ prob x y
+ = let xx = [: (sumpri m ,m)
+ | m <- series (enumFromToP 1 3) x
+ , distinct [: x * 2 | x <- m :] > y :]
+ i = minIndexP [: a | (a, b) <- xx :]
+ in xx !: i
+ in
+ prob 7 2000
+solution3 :: (Int, PArray Int)
+{-# NOINLINE solution3 #-}
+solution3
+ = let (i, is) = solution3'
+ in
+ (i, toPArrayP is)
diff --git a/testsuite/tests/ghc-regress/dph/dotp/DotPVect.hs b/testsuite/tests/ghc-regress/dph/dotp/DotPVect.hs
index 500de2e2d3..5b623017d9 100644
--- a/testsuite/tests/ghc-regress/dph/dotp/DotPVect.hs
+++ b/testsuite/tests/ghc-regress/dph/dotp/DotPVect.hs
@@ -2,7 +2,7 @@
{-# OPTIONS -fvectorise #-}
module DotPVect ( dotp ) where
-import Data.Array.Parallel.Prelude
+import Data.Array.Parallel
import Data.Array.Parallel.Prelude.Double as D
import qualified Prelude
diff --git a/testsuite/tests/ghc-regress/dph/primespj/PrimesVect.hs b/testsuite/tests/ghc-regress/dph/primespj/PrimesVect.hs
index 0b96679bbf..34b3a568b7 100644
--- a/testsuite/tests/ghc-regress/dph/primespj/PrimesVect.hs
+++ b/testsuite/tests/ghc-regress/dph/primespj/PrimesVect.hs
@@ -3,7 +3,7 @@
module PrimesVect (primesVect)
where
-import Data.Array.Parallel.Prelude
+import Data.Array.Parallel
import Data.Array.Parallel.Prelude.Int
import qualified Prelude
diff --git a/testsuite/tests/ghc-regress/dph/primespj/dph-primespj.T b/testsuite/tests/ghc-regress/dph/primespj/dph-primespj.T
index 04b9de99cd..458490456b 100644
--- a/testsuite/tests/ghc-regress/dph/primespj/dph-primespj.T
+++ b/testsuite/tests/ghc-regress/dph/primespj/dph-primespj.T
@@ -12,7 +12,6 @@ test ('dph-primespj-opt'
test ('dph-primespj-fast'
, [ reqlib('dph-par')
, reqlib('dph-prim-par')
- , expect_broken(5065)
, only_ways(['normal', 'threaded1', 'threaded2']) ]
, multimod_compile_and_run
, [ 'Main'
diff --git a/testsuite/tests/ghc-regress/dph/quickhull/QuickHullVect.hs b/testsuite/tests/ghc-regress/dph/quickhull/QuickHullVect.hs
index 92a7bb6e06..29aaa4a823 100644
--- a/testsuite/tests/ghc-regress/dph/quickhull/QuickHullVect.hs
+++ b/testsuite/tests/ghc-regress/dph/quickhull/QuickHullVect.hs
@@ -5,7 +5,7 @@ module QuickHullVect (quickhull) where
import Types
-import Data.Array.Parallel.Prelude
+import Data.Array.Parallel
import Data.Array.Parallel.Prelude.Double
import qualified Data.Array.Parallel.Prelude.Int as Int
diff --git a/testsuite/tests/ghc-regress/dph/quickhull/Types.hs b/testsuite/tests/ghc-regress/dph/quickhull/Types.hs
index eebc392577..162458f424 100644
--- a/testsuite/tests/ghc-regress/dph/quickhull/Types.hs
+++ b/testsuite/tests/ghc-regress/dph/quickhull/Types.hs
@@ -3,7 +3,7 @@
module Types ( Point, Line, points, xsOf, ysOf) where
-import Data.Array.Parallel.Prelude
+import Data.Array.Parallel
type Point = (Double, Double)
type Line = (Point, Point)
diff --git a/testsuite/tests/ghc-regress/dph/quickhull/dph-quickhull.T b/testsuite/tests/ghc-regress/dph/quickhull/dph-quickhull.T
index 0f856e567d..f1a1debe3f 100644
--- a/testsuite/tests/ghc-regress/dph/quickhull/dph-quickhull.T
+++ b/testsuite/tests/ghc-regress/dph/quickhull/dph-quickhull.T
@@ -12,7 +12,6 @@ test ('dph-quickhull-opt'
test ('dph-quickhull-fast'
, [ reqlib('dph-par')
, reqlib('dph-prim-par')
- , expect_broken(5065)
, only_ways(['normal', 'threaded1', 'threaded2']) ]
, multimod_compile_and_run
, [ 'Main'
diff --git a/testsuite/tests/ghc-regress/dph/smvm/SMVMVect.hs b/testsuite/tests/ghc-regress/dph/smvm/SMVMVect.hs
index 21ba6b1f11..93f3775741 100644
--- a/testsuite/tests/ghc-regress/dph/smvm/SMVMVect.hs
+++ b/testsuite/tests/ghc-regress/dph/smvm/SMVMVect.hs
@@ -2,7 +2,7 @@
{-# OPTIONS -fvectorise #-}
module SMVMVect (smvm) where
-import Data.Array.Parallel.Prelude
+import Data.Array.Parallel
import Data.Array.Parallel.Prelude.Double as D
import Data.Array.Parallel.Prelude.Int as I
diff --git a/testsuite/tests/ghc-regress/dph/words/WordsVect.hs b/testsuite/tests/ghc-regress/dph/words/WordsVect.hs
index 940aa91f5a..43880fd563 100644
--- a/testsuite/tests/ghc-regress/dph/words/WordsVect.hs
+++ b/testsuite/tests/ghc-regress/dph/words/WordsVect.hs
@@ -20,7 +20,7 @@ where
import qualified Data.Array.Parallel.Prelude.Word8 as W
import Data.Array.Parallel.Prelude.Word8 (Word8)
import Data.Array.Parallel.Prelude.Int
-import Data.Array.Parallel.Prelude
+import Data.Array.Parallel
import qualified Prelude as Prel