COFFEE - A COmpiler For Fast Expression Evaluation
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
coffee Count flops in array initialisations Jul 6, 2018
condarecipe Use git describe for version and build number Jan 25, 2016
doc Add version file Sep 30, 2014
tests Merge branch 'master' into hoist-reduction-loops Nov 28, 2016
.binstar.yml Add conda recipe and binstar-build file Jan 25, 2016
.gitignore Add gitignore file Sep 30, 2014
.travis.yml enable Python 3 testing Nov 11, 2016
AUTHORS Update AUTHORS Jul 15, 2015
LICENSE Purge COFFEE of PyOP2 Sep 28, 2014
README.rst Update README May 17, 2016
setup.cfg minor fixes: flake8, test, cyclic imports Nov 25, 2016



COFFEE is a COmpiler For Fast Expression Evaluation. Given mathematical expressions embedded in a loop nest, COFFEE can be driven in the application of two classes of transformations:

  • Expression rewriting, for flops minimisation. A small set of rewrite operators, such as expansion, factorization, and generalized code motion, can be composed with the aim of reducing the operation count.
  • Code specialisation, to maximise the impact of low level optimisation. For example, COFFEE can analyse the arrays, loops, and memory access pattern in a kernel, and then autonomously decide on the application of padding and data alignment, a transformation for enhancing the effectiveness of compiler auto-vectorisation.

COFFEE is currently used in Firedrake, an automated system for the solution of partial differential equations using the finite element method. An optimisation pipeline in COFFEE was designed to exploit a fundamental mathematical property of finite element integration kernels, namely linearity of operators in test and trial functions.