Improving compatiblity and robustness of OpenCL code