Parallel Programming in Futhark¶
Welcome to “Parallel Programming in Futhark”, an introductionary book about the Futhark programming language. Futhark is a data-parallel array programming language that uses the vocabulary of functional programming to provide a parallel programming model that is easy to understand, yet can be compiled to very efficient code by an optimising compiler. Futhark is a small language - it is not designed to replace general-purpose langages for application programming. The intended use case is that Futhark is only used for relatively small but compute-intensive parts of an application, as the Futhark compiler generates code that can be easily called from non-Futhark code. The language was originally developed in Denmark, and is therefore named after the Runic alphabet.
This book is written for a reader who already has some programming experience. Prior experience with functional programming is useful, but not required. We will be learning Futhark through small examples that each aim to demonstrate some feature or facet of the language. Furthermore, we will discusss some of the theorical background of data-parallel programming, as well as elaborate on some of the optimisations that can be expected from the compiler.
Contributing to the book¶
The book is Open Source, maintained on Github, and distributed under the Creative Commons Attribution (By) 4.0 license. All code snippets in the book, including code in the book’s repository directory is distributed under the ISC license. We will appreciate pull-requests for fixing any kinds of typos and errors in the text and in the enclosed programs, or making any other improvement. The book’s main repository is https://github.com/diku-dk/futhark-book.
This work has been partially supported by the Danish Strategic Research Council, Program Committee for Strategic Growth Technologies, for the research center HIPERFIT: Functional High Performance Computing for Financial Information Technology (hiperfit.dk) under contract number 10-092299.
Table of contents¶
- The Futhark Language
- When Things Go Wrong
- A Parallel Cost Model for Futhark Programs
- Algebraic Properties of SOACs
- Parallel Algorithms