title: How to handle a variable number of algorithms in a kernel?
body: <p>I'm capturing video frames. Every frame is passed into the kernel as an Image2D. I've got about five simple image processing algorithms (blur, sharpen etc.) which a user can choose of (also a combination of different ones is possible). I see three possibilities here:</p>
  
  <ol>
  <li>One kernel: At runtime construct the string of the kernel with the
  chosen algorithms and compile (and take the overhead of the one-time
  compiling delay)</li>
  <li>One kernel: Handle the chosen algorithms with flags (although I understand that conditional branches are undesirable)</li>
  <li>Many kernels (one per algorithm): Seems to be the issue, that an <code>Image2D</code> can either be <code>read_only</code> or <code>write_only</code> and I would need to repetively copy the image from and to the GPU as one output image of a kernel is the input image of the next kernel.</li>
  </ol>
  
  <p>Is there a suggested rule of thumb which way to follow?</p>