title: OpenCL channels dynamic indexing
body: <p>I want to implement a systolic structure for matrix multiplication. My objective is to use a single kernel for every Processing Element so I will execute the same kernel from the host part multiple times. </p>
  
  <p>To communicate between kernels I would like to use channels or pipes. The problem is that "channels extension does not support dynamic indexing into arrays of channel IDs". The number of kernels will depend on the size of the matrix so I will need some method to connect the channels to the corresponding kernels automatically.</p>
  
  <p>Summarizing, I am looking for a method to create this functionality:</p>
  
  <pre><code>channel float c0[32];
  
  __kernel void producer (__global float * data_in){
      for(int i=0; i&lt;32; i++){
          write_channel_altera(c0[i],data_in[i]);
      }
  }
  
  __kernel void consumer (__global float * ret_buf){
      for(int i=0; i&lt;32; i++){
          ret_buf[i]=read_channel_altera(c0[i]);
      }
  }
  </code></pre>
  
  <p>Thanks in advance!</p>