CPU only tests

To enable running the tests on machines with only the CPU, the GPU related codes have to be separated. 

Related issue: #468
Could you return this to the original one-line format?

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces