Hi,
This is expected behavior. Within a kernel, multiple channel calls (to different channels) are considered independent. This can be a problem if channels form a cycle between kernels.
When I compile your code, the compiler generates a warning as follows: (check your log files)
- Compiler Warning: Kernels comp and generator may form a cycle due to connectivity of channels channels[0] and channels[1]. Use mem_fence if you require source code-based ordering of channel operations. Channel depths cannot be optimized.
Ideally, you want to avoid forming a cycle between kernels with channels.
https://www.intel.com/content/www/us/en/programmable/documentation/mwh1391807965224.html#mwh1391806067772