Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
15478 Discussions

Two kernels on the same Device

Altera_Forum
Honored Contributor II
796 Views

Hi again! 

 

I want to have two kernels that one starts over the other (not parallel/concurrent). This restriction is imposed because kernel1 and kernel will share the same buffer. 

 

So, kernel1 starts do its operations and update the buffer, then instead of coming back to the host, i want to send a flag from kernel1 to the kernel2 by a channel saying that kernel1 finished and kernel2 must start. Do i have to got two command queues for each kernel? 

 

Thanks in advance
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
85 Views

If the two kernels are not going to overlap, then there is no need to do this. Just enqueue both kernels in the same queue one after the other, and the second kernel will automatically launch after the first one finishes execution in which case the shared buffer will have been fully updated by the time the second kernel starts. 

 

Note that global memory consistency in OpenCL is only guaranteed *after* kernel execution; trying to synchronize global memory between two kernels using messages sent via channels will *not* work (I tried it once, got incorrect results).
Altera_Forum
Honored Contributor II
85 Views

 

--- Quote Start ---  

If the two kernels are not going to overlap, then there is no need to do this. Just enqueue both kernels in the same queue one after the other, and the second kernel will automatically launch after the first one finishes execution in which case the shared buffer will have been fully updated by the time the second kernel starts. 

 

Note that global memory consistency in OpenCL is only guaranteed *after* kernel execution; trying to synchronize global memory between two kernels using messages sent via channels will *not* work (I tried it once, got incorrect results). 

--- Quote End ---  

 

 

Thanks HRZ, case solved :cool:
Reply