I am looking for a simple example on how to write host and gpu code independently (two different files). My goal is to write the equivalent of the output of the first call to cudafe when using nvcc. The first call to cudafe outputs a x.cudafe1.c and a x.cudafe1.gpu files. I would like to write those files myself. One way would be to use the -keep switch and look at those two files. I tried this but cudafe’s output goes thru some preprocessing that makes the code look really ugly. I was wondering if someone had tried this or had a simple example.