OpenCL support refactoring (half-finished)