Use for-loops instead of while-loops to work around a bug in NVIDIAs OpenCL.
Use for-loops instead of while-loops to work around a bug in NVIDIAs OpenCL.

@melsman this bug is not your fault, but merely reflects the dark side
of GPUs!  Anyway, for-loops are arguably the better way to express
this function.

diku-dk/futhark,HIPERFIT/futhark,HIPERFIT/futhark,ihc/futhark,ihc/futhark,ihc/futhark,diku-dk/futhark,HIPERFIT/futhark,diku-dk/futhark,diku-dk/futhark,diku-dk/futhark