title: What is difference between setting host and executing function?
body: <p>I am trying to make a convolution Image using Opencl. </p>
  
  <pre><code>__kernel void convolution_read4(__global uchar *in1, __global uchar* in2,
  __constant float* mask, int  height,  int  width,  int  kernelSize,
  __local float* lMem, int  localHeight, int  localWidth)
  {
      convolution(in1, in2, mask, height, width, kernelSize, lMem, localHeight, localWidth);
      convolution(in2, in1, mask, height, width, kernelSize, lMem, localHeight, localWidth);
      convolution(in1, in2, mask, height, width, kernelSize, lMem, localHeight, localWidth);
  }
  </code></pre>
  
  <p>Upper code executes same function 3 times.</p>
  
  <pre><code>    err = kernel.setArg(0, d_inputImage);
      err |= kernel.setArg(1, d_outputImage);
      err |= kernel.setArg(2, d_filter);
      err |= kernel.setArg(3, Height);
      err |= kernel.setArg(4, Width);     
      err |= kernel.setArg(5, kernelSize);
      err |= kernel.setArg(6, localSize, NULL);
      err |= kernel.setArg(7, localHeight);
      err |= kernel.setArg(8, localWidth);        
  
      int totalWorkItemX = roundUp(Width - paddingPixels, wgWidth);
      int totalWorkItemY = roundUp(Height - paddingPixels , wgHeight);
  
      cl::NDRange globalws(totalWorkItemX, totalWorkItemY);
      cl::NDRange localws(wgWidth, wgHeight);
  
      err = queue.enqueueNDRangeKernel(kernel, cl::NullRange,
          globalws, localws, NULL, NULL);
  
      err = kernel.setArg(1, d_inputImage);
      err |= kernel.setArg(0, d_outputImage);
      err = queue.enqueueNDRangeKernel(kernel, cl::NullRange,
          globalws, localws, NULL, NULL);
  
      err = kernel.setArg(0, d_inputImage);
      err |= kernel.setArg(1, d_outputImage);
      err = queue.enqueueNDRangeKernel(kernel, cl::NullRange,
          globalws, localws, NULL, NULL);
  
      queue.finish();
  </code></pre>
  
  <p>this code also execute same function "Convolution", but kernel code was changed like that. </p>
  
  <pre><code>__kernel void convolution_read4(__global uchar *in1, __global uchar* in2,
      __constant float* mask, int  height,  int  width,  int  kernelSize,
      __local float* lMem, int  localHeight, int  localWidth)
      {
          convolution(in1, in2, mask, height, width, kernelSize, lMem, localHeight, localWidth);                  
      }
  </code></pre>
  
  <p>I think this two code is same code. but first code drew a wrong output.
  I don't know what is difference between this two.</p>