Reduce duplication in ImpGen.Kernels.
Reduce duplication in ImpGen.Kernels.

diku-dk/futhark,ihc/futhark,HIPERFIT/futhark,CulpaBS/wbBach,diku-dk/futhark,ihc/futhark,HIPERFIT/futhark,diku-dk/futhark,mrakgr/futhark,mrakgr/futhark,mrakgr/futhark,diku-dk/futhark,diku-dk/futhark,HIPERFIT/futhark,ihc/futhark