Forum Discussion
Altera_Forum
Honored Contributor
12 years agoIf you have a gating 'if' statement that prevents some work-items from performing calculations they will quickly early out. For each work-item that needs to early out that will happen on a per work-item bases so they do consume computation cycles to perform the condition checking but for a long running kernel this overhead will be in the noise.
On the Altera platform the NDRange launch size isn't important (except the typical launching of a tiny NDRange for kernels that execute very quickly wouldn't be ideal but that's the case for any vendor). I suspect with the other vendors you have used NDRange sizing was important due to the way the scheduling works (warp/wavefront). On the Altera platform there is no concept of a warp or wavefront that you need to deal with. On the Altera platform there are benefits of putting bounds on the work-group size though. You can configure the maximum work-group size or a fixed work-group size (ideal if your algorithm lends itself to it) using attibutes. The default maximum work-group size is 256 so if you want a different maximum/required size those attributes can change it. I'm not sure about the last question, are you asking whether you should pick a maximum work-group size when compiling the kernel that will cover all the different work-group sizes that the host application will throw at the hardware? If so then generally speaking I would say yes, especially if you need to be able to handle work-groups larger than 256 work-items.