Ticket #21 (closed defect: fixed)
Texture binding for IndexScalar does not work properly with the projection on tuple arrays.
| Reported by: | seanl | Owned by: | seanl |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | CUDA backend | Version: | 0.7.1.0 |
| Keywords: | Cc: |
Description
The execution of the code fragment
bar3 :: Vector (Word32, Int, Word32) -> Acc (Vector (Word32, Int, Word32))
bar3 xs
= let
xs' = use xs
ys' = use (fromList 10 $ Prelude.zip3 [100..] [1000..] [10000..]) :: Acc (Vector (Word32, Int, Word32))
in flip map xs' $ \x -> let (a :: Exp Word32, b :: Exp Int, c :: Exp Word32) = untuple x
(a' :: Exp Word32, b' :: Exp Int, c' :: Exp Word32) = untuple (ys' Acc.! (b - 1))
in tuple (a * a', b * b', c * c')
main :: IO ()
main = do
let input3 = fromList 10 (Prelude.zip3 [0..9] [1..10] [2..11]) :: Vector (Word32, Int, Word32)
r <- CUDA.run $ bar3 input3
putStrLn $ show r
must produce
Array 10 [(0,1000,20000),(101,2002,30003),(204,3006,40008),(309,4012,50015),(416,5020,60024),(525,6030,70035),(636,7042,80048),(749,8056,90063),(864,9072,100080),(981,10090,110099)]
as the result.
As the liftExp (Prj _ e) in Data/Array/Accelerate/CUDA/Execute.hs simply returns an empty list and bind in the same module computes the texture number incorrectly, the CUDA backend failed to produce the correct result:
Array 10 [(0,0,0),(0,0,0),(0,0,0),(0,0,0),(0,0,0),(0,0,0),(0,0,0),(0,0,0),(0,0,0),(0,0,0)]
Change History
Note: See
TracTickets for help on using
tickets.
