compute actual local workgroup size, instead of a hard-coded value

This commit is contained in:
erwin coumans
2013-05-01 10:04:56 -07:00
parent 6d21d10cb4
commit 3438d1c8f6
3 changed files with 13 additions and 0 deletions

View File

@@ -15,6 +15,13 @@ void bitonicSortNv(cl_mem pKey, int arrayLength, b3BitonicSortInfo& info)
info.dir = (info.dir != 0);
cl_int ciErrNum;
size_t localWorkSize, globalWorkSize;
int res = -1;
cl_int clerr=clGetKernelWorkGroupInfo (info.bitonicSortLocal1,info.dev,CL_KERNEL_WORK_GROUP_SIZE,sizeof(size_t),&res,NULL);
if((clerr==CL_SUCCESS)&&(res>0))
info.localSizeLimit=res;
if(arrayLength <= info.localSizeLimit)
{
b3Assert( ( arrayLength) % info.localSizeLimit == 0);