Changes between Initial Version and Version 4 of Ticket #20
 Timestamp:
 08/08/10 15:30:15 (7 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

Ticket #20
 Property version changed from to 0.7.1.0

Ticket #20 – description
initial v4 2 2 3 3 {{{ 4 {# LANGUAGE ParallelListComp,ScopedTypeVariables #}4 {# LANGUAGE ScopedTypeVariables #} 5 5 6 module Foowhere6 module Main where 7 7 8 import Prelude hiding (map) 9 import qualified Prelude 10 11 import Data.Array.Unboxed 12 import Data.Array.IArray 13 14 import Data.Array.Accelerate 15 import qualified Data.Array.Accelerate as Acc 8 import Data.Array.Accelerate (Acc, Exp, Vector) 9 import qualified Data.Array.Accelerate as Acc 16 10 import qualified Data.Array.Accelerate.CUDA as CUDA 17 11 18 foo:: Vector ((Float, Int), Double) > Acc (Vector ((Float, Int), Double))19 fooxs =20 let xs' = use xs21 in flip map xs' $ \x > let (a', c :: Exp Double) =untuple x22 (a :: Exp Float, b :: Exp Int) =untuple a'23 in tuple (tuple (a + 1, b + 2), c + 3)12 test :: Vector ((Float, Int), Double) > Acc (Vector ((Float, Int), Double)) 13 test xs = 14 let xs' = Acc.use xs 15 in flip Acc.map xs' $ \x > let (a', c :: Exp Double) = Acc.untuple x 16 (a :: Exp Float, b :: Exp Int) = Acc.untuple a' 17 in Acc.tuple (Acc.tuple (a + 1, b + 2), c + 3) 24 18 25 19 main :: IO () 26 main = do 27 let input = fromList 10 (Prelude.zip (Prelude.zip [0..9] [1..10]) [2..11]) :: Vector ((Float, Int), Double) 28 (CUDA.run $ foo input) >>= putStrLn . show 20 main = 21 let input = Acc.fromList 10 (zip (zip [0..9] [1..10]) [2..11]) 22 in 23 print =<< CUDA.run (test input) 29 24 }}}