I re-organized the code to be consistent with cuda standards regarding __device__ functions. I also corrected an error in the use of __const__ by replacing them with macros, i.e. #define. See email for more info.