Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17267 讨论

NDRange Channel Implementation

Altera_Forum
名誉分销商 II
1,815 次查看

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 项奖励
4 回复数
Altera_Forum
名誉分销商 II
676 次查看

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 项奖励
Altera_Forum
名誉分销商 II
676 次查看

 

--- 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 项奖励
Altera_Forum
名誉分销商 II
676 次查看

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 项奖励
Altera_Forum
名誉分销商 II
676 次查看

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 项奖励
回复