Changes between Version 4 and Version 6 of Ticket #22

Show
Ignore:
Timestamp:
08/09/10 13:54:49 (4 years ago)
Author:
seanl
Comment:

Fixed it by replacing

f_arr <- liftFun f env

in the dispatch function for scan and fold

with

f_arr <- (++) <$> liftExp x env <*> liftFun f env

to lift the free array variables from both the default value expression and the scalar function.

Also, I added

release f_arr

at the end of dispatchScan to make sure that the device memory allocated for the free array variable.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #22

    • Property status changed from new to assigned
  • Ticket #22 – description

    v4 v6  
    44 
    55{{{ 
    6 foo :: Vector Word32 -> Acc (Scalar Word32) 
     6foo :: Vector Word32 -> Acc (Vector Word32) 
    77foo xs 
    88  = let 
    99      xs' = use xs 
    1010    in 
    11     Prelude.snd $ Acc.scanl const (xs' Acc.! constant 4) xs' 
     11    Prelude.fst $ Acc.scanl const (xs' Acc.! constant 4) xs' 
    1212 
    1313main :: IO () 
     
    2121 
    2222{{{ 
    23 Array () [4] 
     23Array 10 [4,4,4,4,4,4,4,4,4,4] 
    2424}}} 
    2525 
     
    2727 
    2828{{{ 
    29 Array () [0] 
     29Array 10 [0,0,0,0,0,0,0,0,0,0] 
    3030}}}