add support to pointer offset by handling CL_INVALID_MEM_OBJECT error