Proper version of f8ced75 that was reverted earlier. There was an
off by one error. Also fixes the OpenCL versions of the formats.
Hopefully this settles it for #654 and #655.