  In this article we present our implementation of a Hybrid Monte Carlo
algorithm for Lattice Gauge Theory using two degenerate flavours of
Wilson-Dirac fermions on a Fermi GPU. We find that using registers instead of
global memory speeds up the code by almost an order of magnitude. To map the
array variables to scalars, so that the compiler puts them in the registers, we
use code generators. Our final program is more than 10 times faster than a
generic single CPU.
