title: Should I unify two similar kernels with an 'if' statement, risking performance loss?
body: <p>I have 2 very similar kernel functions, in the sense that the code is nearly the same, but with a slight difference. Currently I have 2 options:  </p>
  
  <ul>
  <li>Write 2 different methods (but very similar ones)  </li>
  <li>Write a single kernel and put the code blocks that differ in an if/else statement</li>
  </ul>
  
  <p>How much will an if statement affect my algorithm performance?<br>
  I know that there is no branching, since all threads in all blocks will enter either the if, or the else.<br>
  So will a single if statement decrease my performance if the kernel function is called a lot of times?</p>