diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2018-06-02 11:56:58 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-06-02 16:21:12 -0400 |
commit | faee23bb69ca813296da484bc177f4480bcaee9f (patch) | |
tree | 28e1c99f0de9d505c1df81ae7459839f5db4121c /testsuite/tests/dph/smvm/Main.hs | |
parent | 13a86606e51400bc2a81a0e04cfbb94ada5d2620 (diff) | |
download | haskell-faee23bb69ca813296da484bc177f4480bcaee9f.tar.gz |
vectorise: Put it out of its misery
Poor DPH and its vectoriser have long been languishing; sadly it seems there is
little chance that the effort will be rekindled. Every few years we discuss
what to do with this mass of code and at least once we have agreed that it
should be archived on a branch and removed from `master`. Here we do just that,
eliminating heaps of dead code in the process.
Here we drop the ParallelArrays extension, the vectoriser, and the `vector` and
`primitive` submodules.
Test Plan: Validate
Reviewers: simonpj, simonmar, hvr, goldfire, alanz
Reviewed By: simonmar
Subscribers: goldfire, rwbarton, thomie, mpickering, carter
Differential Revision: https://phabricator.haskell.org/D4761
Diffstat (limited to 'testsuite/tests/dph/smvm/Main.hs')
-rw-r--r-- | testsuite/tests/dph/smvm/Main.hs | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/testsuite/tests/dph/smvm/Main.hs b/testsuite/tests/dph/smvm/Main.hs deleted file mode 100644 index d6b9a0f55c..0000000000 --- a/testsuite/tests/dph/smvm/Main.hs +++ /dev/null @@ -1,60 +0,0 @@ -{-# LANGUAGE TypeOperators #-} - -import SMVMVect (smvm) - -import Control.Exception (evaluate) -import System.IO -import System.Environment - -import qualified Data.Array.Parallel.Unlifted as U -import Data.Array.Parallel.Prelude -import Data.Array.Parallel.PArray as P - - --- Load sparse matrix from a file -loadSM :: String - -> IO (PArray (PArray (Int, Double)), PArray Double) - -loadSM s - = do - (segd, m, v) <- loadSM' s - return $ (nestUSegd segd (fromUArray2 m), fromUArray v) - - -loadSM' :: String - -> IO ( U.Segd - , U.Array (Int, Double) - , U.Array Double) -loadSM' fname = - do - h <- openBinaryFile fname ReadMode - lengths <- U.hGet h - indices <- U.hGet h - values <- U.hGet h - dv <- U.hGet h - let segd = U.lengthsToSegd lengths - m = U.zip indices values - evaluate lengths - evaluate indices - evaluate values - evaluate dv - return (segd, m, dv) - -main - = do [inFile, outFile] <- getArgs - (m, v) <- loadSM inFile - let result = smvm m v - - -- ignore wibbles in low-order bits - let output - = (unlines - $ map (take 12) - $ map show - $ P.toList result) - ++ ("SUM = " - ++ (take 12 $ show $ sum $ P.toList result) - ++ "\n") - - -- check our result against the provided outFile - outputCheck <- readFile outFile - print $ output == outputCheck |