Fork me on GitHub

Will Futhark work on Apple Silicon?

Posted on November 11, 2020 by Troels Henriksen

Apple is coming out with computers that are basically ARM64, but with a different ABI than existing ARM64 for some reason. They call the architecture Apple Silicon, which is a wonderful term that will undoubtedly never become dated or insufficiently precise.

Anyway, you see various posts such Will R Work on Apple Silicon? where language developers answer whether their language will work on these new machines. Since these machines will support transparent emulation of x86, the simple answer is yes. Apple’s emulation was quite good during the PPC-to-x86 transition, so this is trustworthy. Of course, emulation is never going to be as fast as native compilation. For R, the problem is that they depend on some Fortran code, and there is not yet a Fortran compiler available for Apple Silicon.

Well, I can confirm that Futhark depends on absolutely no Fortran. Futhark compiles to C (or Python), and does not care about the specific target architecture. Therefore, Futhark programs should run fine on Apple Silicon. The bigger problem is that Apple has deprecated OpenCL, and does not support CUDA at all due to being grumpy with NVIDIA, so there may eventually be no way to run Futhark on a GPU on macOS. It is unlikely that we will find the time to add a backend for Apple’s proprietary Metal API that is supported absolutely nowhere else, but it’s possible that we’ll finish Futhark’s embryonic Vulkan backend. While macOS does not come bundled with Vulkan, even Apple probably cannot hold back this eruption.

And of course, the Futhark multi-core backend should run well on any Unix-like system.