Shared memory algorithm working for OpenCL