fixed problem observed on Linux where function to generate reference images needed to be done outside of the .cu file.