Forum Discussion
Altera_Forum
Honored Contributor
8 years agoI had never seen this multithreaded example before, it must be new. Based on this example, it should be possible to access the same device from multiple threads, as long as all of them have the same OpenCL context and use the same binary, and the FPGA reconfiguration happens before the threads are created. Still, Altera's own example can be perfectly implemented using one thread with two queues running in parallel, and there is no necessity to implement it like this.
Have you followed the same flow as Altera's example for your own code? The clWaitForEvents() call is not waiting for an event from the other thread, is it? Regarding your profiling output, what is happening when that write_data kernel is not running (the gaps in the time chart)? Have you made sure that the flow of waiting for events in your code is correct? Maybe the write_kernel is waiting for some event that it shouldn't wait for and that is why those gaps are happening.