attempt at porting to OpenCL 1.2, still needs work on clspatial.cpp