title: Local memory using C++ Wrappers
body: <p>I wish to use local work groups for my kernels, but I'm having some issues passing the 'NULL' parameters to my kernels. I hope to know how to pass these parameters using the methods that I'm using which I will show below, as opposed to setArg which I saw here: <a href="https://stackoverflow.com/questions/8888718/how-to-declare-local-memory-in-opencl">How to declare local memory in OpenCL?</a></p>
  
  <p>I have the following host code for my kernel:</p>
  
  <p><em>initialized in a .h file</em>:</p>
  
  <pre><code>std::shared_ptr&lt;cl::make_kernel&lt;cl::Buffer, cl::Buffer&gt;&gt; setInputKernel;
  </code></pre>
  
  <p><em>in host code</em>:</p>
  
  <pre><code>this-&gt;setInputKernel.reset(new cl::make_kernel&lt;cl::Buffer, cl::Buffer&gt;(program, "setInputs"));
  </code></pre>
  
  <p><em>enqueue kernel code</em>:</p>
  
  <pre><code>(*setInputKernel)(cl::EnqueueArgs(*queue, cl::NDRange(1000),cl::NDRange(1000)),
              cl::Buffer, cl::Buffer);
  </code></pre>
  
  <p><em>kernel code</em>:</p>
  
  <pre><code>kernel void setInputs(global float* restrict inputArr, global float* restrict inputs)
  </code></pre>
  
  <p>I have already set the appropriate sizes and setting for my local work group parameters. However, I did not successfully pass the data into the kernel.</p>
  
  <p>The kernel with the local work group updates:</p>
  
  <pre><code>kernel void setInputs(global float* restrict inputArr, global float*
                        restrict inputs, local float* inputArrLoc, local float* inputsLoc)
  </code></pre>
  
  <p>I had tried to change my code accordingly by using NULL or cl::Buffer for the input params of the kernels, but didn't work:</p>
  
  <pre><code>std::shared_ptr&lt;cl::make_kernel&lt;cl::Buffer, cl::Buffer, NULL, NULL&gt;&gt; setInputKernel;
  std::shared_ptr&lt;cl::make_kernel&lt;cl::Buffer, cl::Buffer, cl::Buffer, cl::Buffer&gt;&gt; setInputKernel;
  </code></pre>
  
  <p>with the first attempt giving me compiler issues saying that the function expects a value while I did not give one, and the second attempt returning clSetKernelArg error when I try to run the kernel. In both examples, I had ensured that all the parameters for the headers and host files were consistent.</p>
  
  <p>I also tried to just put NULL behind my cl::Buffers when I enqueue the kernel, but this returns an error telling me that there is no function for call.</p>
  
  <p>How do I pass parameters to my kernel in my example?</p>