Forum Discussion
Altera_Forum
Honored Contributor
8 years ago --- Quote Start --- The channel stops when passing large amount of data from one kernel to another, but it works just nice for the small piece of data. --- Quote End --- Channel-related deadlocks only happen due to incorrect channel ordering. If you have multiple channel operations in a single kernel, the compiler might reorder them to achieve better pipeline performance, unless you explicitly force channel ordering. Because of this, if your code has been written assuming that data is read and written in the same order as channel operations follow each other in the code, you might run into a deadlock. --- Quote Start --- Does the read_channel_altera will be executed right after the write_channel_altera takes place? Or the data only available after the producer kernel finish it's loop? --- Quote End --- Neither. For such cases, you should run the two kernels in parallel in two different queues. In this case, both calls will run in parallel, with the write side automatically stalling when the buffer is full, and the read side automatically stalling if the buffer is empty. This code example will never deadlock regardless of which kernels is invoked sooner or how much data is passed. --- Quote Start --- In my case, I am using EnqueueTask kernel, Does channels works the same as in NDrange Kernel?? --- Quote End --- More or less the same.