Forum Discussion
Altera_Forum
Honored Contributor
11 years agoYou are correct, there wouldn't be any benefit of using channels in that particular example. The writer is just using it as an example to show how to take a very simple NDRange kernel that just copies a buffer and showing the functional equivalent using two kernels, one that reads from memory and stuffs the data into a channel, while the other pulls the data out of the channel and places it into memory. Note that the code is fairly old and it contains an attribute that isn't supported called autorun. If I was to code the example in figure 4 with the tools today I would just have two task kernels (single work-item execution) with a loop that dictates how many times memory is read/written to.
I recommend taking a look at the design examples here that mention channels in the feature column: http://www.altera.com/support/examples/opencl/opencl.html The ones that use channels do so for very good reasons that you can learn from to see if it's doing something similar with your own kernels.