There was an error in the OpenCL code. The error was in computing the
period index. Fixed.