Fix a problem when reusing current OpenCL resources.