Also fix some issues that caused the compile to fail when trying to run some of the math functions on a CUDA device. In particular, CUDA is picky about using a global const on a device when the const type is not one of the basic C types.