Adding error checking to OpenCL code.