Skip to content

Commit

Permalink
Correct soacType for Scatter.
Browse files Browse the repository at this point in the history
Fixes #2009.
  • Loading branch information
athas committed Aug 14, 2023
1 parent 865f060 commit 6b0ee49
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Futhark/IR/SOACS/SOAC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,10 @@ soacType (Stream outersize _ accs lam) =
substs = M.fromList $ zip nms (outersize : accs)
Lambda params _ rtp = lam
soacType (Scatter _w _ivs lam dests) =
zipWith arrayOfShape val_ts ws
zipWith arrayOfShape (map (snd . head) rets) shapes
where
indexes = sum $ zipWith (*) ns $ map length ws
val_ts = drop indexes $ lambdaReturnType lam
(ws, ns, _) = unzip3 dests
(shapes, _, rets) =
unzip3 $ groupScatterResults dests $ lambdaReturnType lam
soacType (Hist _ _ ops _bucket_fun) = do
op <- ops
map (`arrayOfShape` histShape op) (lambdaReturnType $ histOp op)
Expand Down

0 comments on commit 6b0ee49

Please sign in to comment.