You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importData.Array.AccelerateasAcctypeAccVectora=Acc (Vectora)
typeAccSparseVectora= ((AccVectorInt), (AccVectora))
getEntry:: (Elta) =>ExpInt->a->AccSparseVectora->Expa
getEntry i d (idx,val) =Acc.snd$ the $Acc.foldAll f def xs
where
xs =Acc.zip idx val
def = constant (0::Int,d)
f ack v = (i ==*Acc.fst v) ? (v, ack)
-- f ack v = (i ==* i) ? (v, ack) -- This fails!-- f ack v = ack -- This works!-- f ack v = v -- This works!vectorFromSparseVector:: (Elta) =>AccSparseVectora->Int->a->AccVectora
vectorFromSparseVector sv@(idx,val) size d =Acc.map m def
where
def = use $ fromList (Z:. size) $take size $ ([1,2..] :: [Int]) ::AccVectorInt
m i = getEntry i d sv
------------
nobug = getEntry 1 (0.0::Float) (idx, val)
where
idx = use $ fromList (Z:. (1::Int)) ([1] :: [Int])
val = use $ fromList (Z:. (1::Int)) ([1] :: [Float])
-------------------------
bug = vectorFromSparseVector (idx, val) 1$ (0.0::Float)
where
idx = use $ fromList (Z:. (1::Int)) ([1] :: [Int])
val = use $ fromList (Z:. (1::Int)) ([1] :: [Float])
and the ghci session:
ghci> bug
let a0 =*** Exception:
*** Internal error in package accelerate ***
*** Please submit a bug report at https://github.com/mchakravarty/accelerate/issues
./Data/Array/Accelerate/Smart.hs:114 (prjIdx): type mismatch
couldn't match expected type `((),Int)' with actual type `(((),Int),Float)'
The text was updated successfully, but these errors were encountered:
via @arj
and the ghci session:
The text was updated successfully, but these errors were encountered: