Convert C++ code to OpenCL