refactored CUDA use flag handling