Get the latest tech news

Tracking source locations in the Futhark compiler


A high-performance and high-level purely functional data-parallel array programming language that can execute on the GPU and CPU.

The frontend always annotated all syntactic constructs with precise source information in order to do good error reporting, but it was thrown away during desugaring and lowering into the intermediate language (IR). This is not an edge case: the basic compilation scheme of the Futhark compiler is to fuse as much as possible based on data dependency information in order to achieve some kind of “normal form” representation, then statically schedule the resulting parallel nests via various flattening transformations, based on its understanding of the concrete parallel hardware (GPUs, for the purpose of this post). Essentially, each Futhark statement is associated with a set of certificates that function as fake data dependencies, which ensures that safety checks are always executed before the expression they protect.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Futhark

Futhark

Photo of source locations

source locations

Photo of Futhark compiler

Futhark compiler

Related news:

News photo

What it takes to add a new back end to Futhark

News photo

NumPy-style broadcasting in Futhark