Forum Discussion
Altera_Forum
Honored Contributor
11 years agoDo you have some code that you can post to put your question into context? To answer your last question the only time I use channels is to communicate to other kernels. If you create a channel where the source and destination are the same kernel you could end up causing scheduling problems since the compiler will not analyze the latency through the channel.
Sometimes a kernel will have dependencies that prevent it from operating optimially. For example if you have a single work-item kernel that reads from memory, performs some operations on that data, then writes the results back to memory, and lets say the operations on the data are non-determistic in terms of processing time. In cases like that you might want to improve the performance by replicating the code but it might not be beneficial to replicate all of the code reponsible for the reading and writing to memory. So you could replicate part of the kernel by putting it into another kernel and adding the replication to only that kernel and use channels to push data into that kernel and pull the results back out. Channels let you decouple the kernel providing the data from the kernel receiving the data and when to use that is highly dependent on the algorithm being accelerated (i.e. there is no general rule of thumb when to use channels).