cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

edward_yang
Journeyman III

local_work_size ptr vs reqd_work_group_size attr

why both ways of defining work group size?

I'm just beginning to learn about OpenCL. My apology if this is a dumb question.

Can someone kindly explain to me why is there the need to have two ways of specifying work group size? I understand that the local_work_size can be specified dynamically in runtime while reqd_work_group_size is static in compile time, but why not just use the local_work_size? What's the possible benefit of using reqd_work_group_size attribute?

Thanks in advance.

0 Likes
3 Replies
nou
Exemplar

IMHO you can hard coded some restriction of local size.

0 Likes

I see. So that would guarantee for example the program would give compile time error when building on a device with insufficient CL_DEVICE_MAX_WORK_GROUP_SIZE?

Seems to make some sense to me. Thanks.

0 Likes

edward_yang,
reqd_work_group_size lets the compiler make assumptions and optimizations about the program that cannot be made when using a dynamic local work size as specified in clNDEnqueueRangeKernel.
0 Likes