Move the CUDA device parsing to cuda_common.cu. This currently does not build
(using -cuda or -gpu build targets), it fails with "../formats.h(206): error:
expected an identifier". I do not have the slightest clue why.