diku-dk / futhark

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

Internal compiler error: lmadcopyCPU: 0 #2100

Closed nqpz closed 5 months ago

nqpz commented 5 months ago

I was going to build a nice histogram of all my unit values, but I'm getting an error.

Program:

entry main (n: i64): () =
  let arr = reduce_by_index
            (replicate n ())
            (\() () -> ())
            ()
            (replicate n 0)
            (replicate n ())
  in arr[0]

Error when using futhark multicore:

lmadcopyCPU: 0
CallStack (from HasCallStack):
  error, called at src/Futhark/CodeGen/Backends/GenericC.hs:74:16 in futhark-0.26.0-inplace:Futhark.CodeGen.Backends.GenericC

There are no errors when using futhark c.

This minimal example seems to work with GPU backends, but I got this runtime error when running the code generated by futhark opencl in the larger codebase of https://github.com/nqpz/raster3d/:

undefined reference to `lmad_copy_gpu2gpu_0b'
athas commented 5 months ago

This one is easy to fix, but the question is where to do it.