Ticket #25 (closed defect: duplicate)
fold produces incorrect result when a non-identity value is given as the default value
| Reported by: | seanl | Owned by: | tmcdonell |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | CUDA backend | Version: | 0.7.1.0 |
| Keywords: | Cc: |
Description
For example,
sum' :: Vector Word32 -> Acc (Scalar Word32)
sum' xs
= let
xs' = use xs
in
fold (*) 1 xs'
main :: IO ()
main = do
let input = fromList 10 [1..] :: Vector (Word32)
putStrLn $ "reference: " ++ (show $ Interpreter.run $ sum' input)
r <- CUDA.run $ sum' input
putStrLn $ "output: " ++ (show r)
produces
reference: Array () [56] output: Array () [311]
Change History
Note: See
TracTickets for help on using
tickets.
