title: Causes for CL_INVALID_WORK_GROUP_SIZE
body: <p>when I change the work group size from <code>16</code> to <code>32</code> or something bigger I get an <code> CL_INVALID_WORK_GROUP_SIZE</code> error. <code>matrix_size</code> is <code>64</code>.</p>
  <pre><code>  localWorkSize[0] = groupsize;
    localWorkSize[1] = localWorkSize[0];
    globalWorkSize[0] = matrix_size;
    globalWorkSize[1] = globalWorkSize[0];
  </code></pre>
  <p>First I checked the documentation for <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clEnqueueNDRangeKernel.html" rel="noreferrer">clEnqueueNDRangeKernel</a> which states four (five) different causes <code>CL_INVALID_WORK_GROUP_SIZE</code>, but I think non of them apply. Please check my conclusions. (I hope you don't mind my QA style)</p>
  <hr />
  <p><strong>Q</strong> <code>CL_INVALID_WORK_GROUP_SIZE if local_work_size is specified and number of work-items specified by global_work_size is not evenly divisable by size of work-group given by local_work_size </code></p>
  <p><strong>A</strong> <em>64 % 32 = 0</em></p>
  <p><strong>Q</strong> <code>or does not match the work-group size specified for kernel using the __attribute__((reqd_work_group_size(X, Y, Z))) qualifier in program source.</code></p>
  <p><strong>A</strong> <em>As I understood the help, I did not use <code>__attribute__</code>.</em></p>
  <p><strong>Q</strong> <code>CL_INVALID_WORK_GROUP_SIZE if local_work_size is specified and the total number of work-items in the work-group computed as local_work_size[0] *... local_work_size[work_dim - 1] is greater than the value specified by CL_DEVICE_MAX_WORK_GROUP_SIZE in the table of OpenCL Device Queries for clGetDeviceInfo.</code></p>
  <p><strong>A</strong> <em>I queried <code>clGetDeviceInfo</code> and <code>CL_DEVICE_MAX_WORK_GROUP_SIZE</code> is <code>512, 512, 64</code></em></p>
  <p><strong>Q</strong> <code>CL_INVALID_WORK_GROUP_SIZE if local_work_size is NULL and the __attribute__((reqd_work_group_size(X, Y, Z))) qualifier is used to declare the work-group size for kernel in the program source.</code></p>
  <p><strong>A</strong> <em><code>local_work_size</code> is not <code>NULL</code></em>.</p>
  <p><strong>Q</strong> <code>CL_INVALID_WORK_ITEM_SIZE if the number of work-items specified in any of local_work_size[0], ... local_work_size[work_dim - 1] is greater than the corresponding values specified by CL_DEVICE_MAX_WORK_ITEM_SIZES[0], .... CL_DEVICE_MAX_WORK_ITEM_SIZES[work_dim - 1].</code></p>
  <p><strong>A</strong> <em>32 &lt; 512</em></p>
  <hr />
  <p>I hope, I haven't overlooked something. Please tell me, when you have an idea what could cause the <code>CL_INVALID_WORK_GROUP_SIZE</code> or found a error in my conclusions.</p>
  <p>Thanks for taking the time to read all this :)</p>