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
Since we tend to stick to the Google style guide, kindly rename this to

static bool g_curand_availability_logged = false;

and likewise below.