Check for gpus only once.
Merge pull request #398 from btovar/gpu_only_once

Check for gpus only once.