Port of functions that only exist in OpenCL, to have the same code in both C and OpenCL