1 of 1 people found this helpful
you have four options. convert outer loop to NDRange with for loop in kernel. but that can lead to low utilization as you need >1000 global size to have good utlization.
second rewrite algoritm that you switch outer and inner loop and make it as first case. so you get enought global size.
third convert it to 2D NDRange so there is no loop in kernel.
and last execute M kernel invocation with N global size.
Please tell me if I got this right
Say, M=4 and N=256. In actuality there are more nests than this.
- Launch NDRange with 4 threads. My kernel would look like
- Change algorithm
- Convert NDRange to 2D. This may not work because I'm using a 1D device arrays already.
- Launch multiple NDRanges
- that is not a problem. you just linearize address array[y*width+x]
- you made typo for(M iterations)clEnqueueNDRange(global=N);
third option can be best because you get biggest global worksize. your problem must be totally parallel. if is there dependency on outer loop then best option is fourth.
Yes, my problem is embarrassingly parallel. Third seems like a good idea. Will try that out. Thanks for the help