made opencl more safe against scheduling, so that global size can be less than what is being iterated over