Error CL_INVALID_WORK_GROUP_SIZE

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Error CL_INVALID_WORK_GROUP_SIZE

Postby bird12358 » Sat Nov 28, 2015 6:57 pm

Hello,

I just use a example which in increment local variable.

When the localworksize variable are smaller than the globalworksize the execution gave me that error :

Error # -54 (CL_INVALID_WORK_GROUP_SIZE)

on that line :

ciErrNum = clEnqueueNDRangeKernel(cqCommandQueue, ckKernel, 1, NULL, &szGlobalWorkSize, &szLocalWorkSize, 0, NULL, NULL);

on that example I have szGlobalWorkSize = 8 and szLocalWorkSize = 16;

Can someone help me?

Best regard.
bird12358
 
Posts: 5
Joined: Thu May 07, 2015 11:20 am

Re: Error CL_INVALID_WORK_GROUP_SIZE

Postby jar » Sat Nov 28, 2015 7:05 pm

The global work size must be a multiple of the local work size. So you have it backwards.

The best configuration, I believe, is a global work size of 16 and a local work size of 1. Give each thread sufficient work to do.
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: Error CL_INVALID_WORK_GROUP_SIZE

Postby nickoppen » Mon Nov 30, 2015 4:20 am

Hi,

I've seen some "unusual" or "odd" or "undocumented" behaviour when trying to use the localworksize parameter. I passed it 16 and when I called get_local_size(0) it returned 14.

I'm not sure what the cause was but I don't use it any more for anything.

nick
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 16 guests

cron