diku-dk / futhark

:boom::computer::boom: A data-parallel functional programming language
http://futhark-lang.org
ISC License
2.41k stars 165 forks source link

Incorrect result with GPU backends #2051

Closed athas closed 1 year ago

athas commented 1 year ago
-- ==
-- compiled random input { [512][32]i32 } auto output

def main [n][m] (xss: [n][m]i32): []i32 =
  reduce (\(xs: []i32) ys ->
               loop zs = replicate m 0 for i < m do
                 let zs[i] = xs[i] + ys[i]
                 in zs
         )
         (replicate m 0)
         xss

Looks to be an error in code generation for non-commutative non-segmented reductions with array operands.