#[unsafe]in front and see if that makes it run properly.
goto, which is probably a mistake. There's no way a GPU can handle non-reducible control flow. But the only use of
gotoin the generated code is to break out of nested loops, which is reducible, so it really ought to work.
type t val index [n] 'a : [n]a -> t -> a
I was originally thinking of something like
let index [n] 't 'i (ts: [n]t) (index: i) = ts[i]
but that won't compile regardless
@Gusten_Isfeldt_gitlab Also, be careful in general. I never finished implementing proper synchronisation for accumulator operators that cannot be implemented with hardware atomics (basically, primitive operators).
@athas would this manifest as incorrect results, and if so, would the errors in general be small, like missed values in the accumulation?
let lj (sigma:f32) (epsilon:f32) (r:f32) = let sdr = sigma/r let sdr2 = sdr*sdr let sdr6 = sdr2*sdr2*sdr2 let sdr12 = sdr6*sdr6 in 4*epsilon*(sdr12-sdr6) let k_B:f32 = 8.617333262125e-5 -- eV/K let p T V = f32.exp (-V/(k_B*T)) let sigma:f32 = 1 let epsilon:f32 = 1 let n:i64 = 100 let rs = tabulate n (\i -> 3*sigma* f32.from_fraction i n) let vs = map (\r -> let v = lj sigma epsilon r in (v, p 300 v)) rs let rvs = zip (zip rs rs) vs -- > :plot2d rvs
Internal compiler error (unhandled IO exception). Please report this at https://github.com/diku-dk/futhark/issues After sending command ["store","/tmp/futhark-server-read1763236-1","out0"] to server process:fd:330: hGetLine: end of file Server process exited unexpectedly with exit code: -11 Server stderr: CallStack (from HasCallStack): error, called at src/Futhark/Server.hs:141:7 in futhark-0.20.0-7O7l1SWHThQFOpbzz8q8kj:Futhark.Server
What am I doing wrong?
yvalues should not be
> :plot2d rvs failed: Invalid data file produced by Futhark server. futhark: testplot-img: getDirectoryContents:openDirStream: does not exist (No such file or directory)
futhark literateis just terrible at handling errors.