title: How can i optimize more my OpenCl kernel
body: <p>I had separated out some functions which are different from one another but needs to run parallel in different workitems. Hence when kernel is called, it needs to decide which function has to be executed..</p>
  
  <pre><code>void call_calc0() {
      // code
  }
  
  void call_calc1() {
      // code
  }
  
  void call_calc2() {
      // code
  }
  
  void call_calc3() {
      // code 
  }
  
  __kernel void perform (__global double* A, __global double* B) {
      int idx = get_global_id(0);
      if (idx == 0) {
          call_calc0();
      } else if (idx == 1) {
          call_calc1();
      } else if (idx == 2) {
          call_calc2();
      } else if (idx == 3) {
          call_calc3();
      }
  }
  </code></pre>
  
  <p>If there are 256/512 workitems, this code sample will not be a correct way. How can i optimize this?</p>