Fixed bugs in the opencl test

The test now works on GPUs with fewer than 512 work-items and
on iMacs with ATI GPUs.