title: Different ways to make kernel
body: <p>In this <a href="http://simpleopencl.blogspot.hu/2013/06/tutorial-simple-start-with-opencl-and-c.html" rel="noreferrer">tutorial</a></p>
  
  <p>There are 2 methods to run the kernel, and another one mentioned in the comments:</p>
  
  <p><strong>1.</strong></p>
  
  <pre><code>cl::KernelFunctor simple_add(cl::Kernel(program,"simple_add"),queue,cl::NullRange,cl::NDRange(10),cl::NullRange);
  simple_add(buffer_A,buffer_B,buffer_C);
  </code></pre>
  
  <p>However, I found out, that KernelFunctor <a href="http://www.khronos.org/message_boards/showthread.php/8317-cl-hpp-KernelFunctor-gone-replaced-with-KernelFunctorGlobal" rel="noreferrer">has gone</a>.</p>
  
  <p>So I tried the alternative way:</p>
  
  <p><strong>2.</strong></p>
  
  <pre><code>cl::Kernel kernel_add=cl::Kernel(program,"simple_add");
  kernel_add.setArg(0,buffer_A);
  kernel_add.setArg(1,buffer_B);
  kernel_add.setArg(2,buffer_C);
  queue.enqueueNDRangeKernel(kernel_add,cl::NullRange,cl::NDRange(10),cl::NullRange);
  queue.finish();
  </code></pre>
  
  <p>It compiles and runs succussfully.</p>
  
  <p>However, there is a 3rd option in the comments:</p>
  
  <p><strong>3.</strong></p>
  
  <pre><code>cl::make_kernel simple_add(cl::Kernel(program,"simple_add"));
  cl::EnqueueArgs eargs(queue,cl::NullRange,cl::NDRange(10),cl::NullRange);
  simple_add(eargs, buffer_A,buffer_B,buffer_C).wait();
  </code></pre>
  
  <p>Which does not compile, I think the make_kernel needs template arguments.
  I'm new to OpenCl, and didn't manage to fix the code.</p>
  
  <p><strong>My question is:</strong></p>
  
  <p><em>1.</em> How should I modify the 3. code to compile?</p>
  
  <p><em>2.</em> Which way is better and why? 2. vs. 3.?</p>