Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17267 Discussions

NDRange Channel Implementation

Altera_Forum
Honored Contributor II
1,809 Views

I'm having some problems with the execution of two kernels communicating via channels in the NDRange environment. Basically there are two kernels with different numbers of work-items and different work-group sizes running simultaneously on the board. Both kernels are iterating through a for-loop that is not unrolled. 

 

They occasionally communicate and synchronize with each other (ie at the start of each loop iteration) via two channels. To handle the variability in the numbers of work-items and different work-group sizes, I've limited the channel accesses to only the first 0th work-item for each kernel. 

 

The code runs perfectly during emulation, but gets stalled when running the compiled project on the FPGA device. Has anyone played around with channels in the NDRange environment? Do all work-items need to pass through a channel read/write for it to be valid?
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
670 Views

Have you considered the sequence of the work-item on real board ? OpenCL does not guarantee the sequence, but for simulation it is always fixed

0 Kudos
Altera_Forum
Honored Contributor II
670 Views

 

--- Quote Start ---  

Have you considered the sequence of the work-item on real board ? OpenCL does not guarantee the sequence, but for simulation it is always fixed 

--- Quote End ---  

 

 

The order of execution shouldn't matter as I'm only using the first work item for the synchronization as follows: 

 

 

if(first work-item) 

Blocking read from channel 

 

barrier
0 Kudos
Altera_Forum
Honored Contributor II
670 Views

may be you could use to print all the item id and all the data that have been writen and read from the channel to see what happened

0 Kudos
Altera_Forum
Honored Contributor II
670 Views

Just something that i got wrong the first time i was playing with channels - are you using different queues for the two kernels? I believe the queues are in-order, so you need multiple queues if you want to launch multiple concurrent kernels. Otherwise the first kernel might be stalled on an empty channel, and since it doesn't return control, you cannot launch the second kernel from the host.

0 Kudos
Reply