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

futhark_context_new can exit the program #2077

Closed dcz-self closed 6 months ago

dcz-self commented 6 months ago

When running an OpenCL backend on a system without any OpenCL devices, futhark_context_new will exit with a message:

Running target/debug/futest (embedded Futhark): Could not find acceptable OpenCL device.

This is rather annoying for portable programs: I'd like the program to be able to try different backends until it finds a working one, rather than tasking the operator to do it manually. I might also want to fall back on non-Futhark code if context creation fails.

athas commented 6 months ago

There is a long tail of places where Futhark will call abort() or exit() or similar - although I think we fixed almost all of the ones that are not in initialisation. Nevertheless, they should all be considered bugs and fixed. I think this one will be quite easy.