Make CUDA example use templates properly