Permalink
Browse files

Updated cabal file and README.md for version 0.1

  • Loading branch information...
1 parent 277721c commit 6983fdc3dfe0613a53faf9dcae4c39f68e173578 @blambo committed Nov 2, 2011
Showing with 38 additions and 2 deletions.
  1. +37 −1 README.md
  2. +1 −1 accelerate-repa.cabal
View
38 README.md
@@ -3,4 +3,40 @@ A back-end for the Accelerate library using the Repa library
This library aims at allowing parallel computations on the CPU to be performed through Accelerate by using Repa as a back-end.
-This back-end is very much in its infancy and so currently does nothing.
+The current implementation generates a string containing the generated code.
+
+Installing the library
+-----------------
+
+First grab a copy of the library by forking/downloading.
+
+Install the library by the commands
+
+ runghc Setup.hs configure
+ runghc Setup.hs build
+ runghc Setup.hs install
+
+You may need to alter these commands depending on your individual set-up.
+
+Running the library
+-------------------
+
+If you are familiar with the use of the Accelerate library you would know of run function exposed by Data.Array.Accelerate.Interpreter or Data.Array.Accelerate.CUDA, depending on which back-end implementation you wish to use. The run command for this back-end implementation is exposed by the module Data.Array.Accelerate.Repa.
+
+Currently the run command for the Repa back-end generates a String representing the generated code for running the given Accelerate program using Repa. You can obviously do what you like with this String, the following is just one method of using it to get the result of the function.
+
+Pass your Accelerate program to the Repa back-end, and pipe the result into a temporary file, compile and run this file to get the result.
+
+An example program is:
+
+ dotp :: Acc (Vector Float) -> Acc (Vector Float) -> Acc (Scalar Float)
+ dotp xs ys = fold (+) 0 (zipWith (*) xs ys)
+
+ main = do $ putStrLn $ Repa.run $ dotp arr1 arr2
+
+Where arr1 and arr2 are your arrays of data. On the command-line (in Unix) you could run it as such:
+
+ $ runghc Example.hs > Temp.hs
+ $ runghc Temp.hs
+
+To get the result.
View
2 accelerate-repa.cabal
@@ -1,5 +1,5 @@
Name: accelerate-repa
-Version: 0.0
+Version: 0.1
Cabal-version: >= 1.6
Tested-with: GHC == 7.0.2
Build-type: Simple

0 comments on commit 6983fdc

Please sign in to comment.