Raytracer running on CPU with kernel templates