Commit 7c4d3ade authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.
Browse files

Adapt DPH tests to recent changes in the DPH libraries.

parent 075655b7
......@@ -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
......@@ -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)
......@@ -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
......
......@@ -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
......
......@@ -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'
......
......@@ -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
......
......@@ -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)
......
......@@ -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'
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment