diku-dk / futhark

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

Type error after pass 'short-circuit-mc' #1774

Closed nbos closed 1 year ago

nbos commented 1 year ago

Compiling the following program

let f [n] [m] [l] (xs: [n]f32) (ys: [m]f32) (zs: *[l]f32) : [n][m]f32 =
  map (\x ->
     map (\y -> f32.sum (map (*y) (map (*x) zs)))
             ys)
      xs

entry main [n] [m] [l] : [n]f32 -> [m]f32 -> *[l]f32 -> [n][m]f32 = f  

with backend multicore results in the error

Internal compiler error.  Please report this:
  https://github.com/diku-dk/futhark/issues
Type error after pass 'short-circuit-mc':
In function entry_main
When checking function body
In expression of statement
  {defunc_2_map_res_6601 : ( {}
                           , [n_6428][m_6429]f32 @ mem_6704 ->
                           {base: [n_6428, m_6429];
                            contiguous: true;
                            LMADs: [{offset: 0i64;
                                     strides: [m_6429, 1i64];
                                     shape: [n_6428, m_6429];
                                     permutation: [0, 1];
                                     monotonicity: [Inc, Inc]}]} )}
Type error:
Name mem_6671 bound twice
Munksgaard commented 1 year ago

Fixed in 6b0437fb652a061eb44d2aff80c14edc86dad7d5