title: OpenCL: same kernel in separate queues
body: <p>OpenCL 1.2: I am running a sequence of kernels in two separate command queues so that they can be scheduled concurrently, synchronising at the end. There are separate data buffers been used in these
  queues.</p>
  
  <p>I started by using the same kernel objects in the separate queues. However, that seemed to get
  the data buffers all mixed up between the two queues. I looked up but could not find anything in the
  references regarding this. In particular, I see nothing explicitly mentioned in the clSetKernelArgs()
  page regarding this. There is a note saying</p>
  
  <blockquote>
    <p>Users may not rely on a kernel object to retain objects specified as argument values to the kernel.</p>
  </blockquote>
  
  <p>which I am not sure applies to this case.</p>
  
  <p>So my devised solution is to inline the kernel code and make two separate kernel functions that
  call this code for each one of the kernels in the two parallel queues. This fixed the issue.</p>
  
  <p>However:
  (1) I was not happy with this, and so I tested again on different devices. Data buffers are
  jumbled up in the Intel HD630 GPU, but not in the AMD Radeon Pro 560 (where all is good).
  (2) This solution does not scale. If I want to implement a larger amount of task parallelism
  using the same context, doing separate kernels for each parallel stream is no good. I have
  not tested two separate contexts, I supposed it would work, but then it would mean copying
  data from one context to the other at the sync point, which defeats the whole exercise.</p>
  
  <p>Has anyone tried this, or have any insights on the issue?</p>