title: Array that does not fit the global size in OepnCl
body: <p>I can't figure how to deal with arrays which size is smaller that the global size sets in <code>clEnqueueNDRangeKernel</code>.</p>
  
  <p>In my atomistic calculation the global size is set by the number of atom. This is the size of the position, velocities and forces. Then, I do a pseudo reduction and store the data in arrays of size corresponding to the number of blocs. I have also a small array to store the parameters of the pair potential.</p>
  
  <p>I don't have any issue with the position, I declare them as <code>__global const double4 *positions</code>. My problem is about the two other kind. From my understanding a thread is associated to each array element but that's not what I want for the small arrays. To me the best way to go is to pass the parameter array as <code>__const</code> or <code>__private</code>, but I'm not sure I can pass an array as <code>__private</code> (like I do with scalar) and setting it as <code>__const</code> produce the error: </p>
  
  <pre><code>:149:80: error: invalid address space for pointee of pointer argument to __kernel function
                           __global float2 *atom_type,__global const double *atmmass, __const double8 *two_body_type,
  </code></pre>
  
  <p>Regarding my reduce array, right now I'm passing it as <code>__global</code> the output is just garbage. When I declare it as <code>__const</code> I get the same error as above and, anyway I guess that would be an issue the get back the data afterward.</p>
  
  <p>How do you guys would do?</p>