Helper functions related to OpenCL