Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Honored Contributor I
775 Views

stream applications

Hello, 

I'm new on OpenCL and Altera HLS. 

Do you know (and do you have any example) on how I can implement a stream application? 

In other words, I want that the host constantly send some data to the kernels and constantly collect the output results. Kernels should be always actives. This require a shift from the accelerator based paradigm (my understanding) imposed by OpenCL. 

Thanks!
0 Kudos
3 Replies
Highlighted
Honored Contributor I
8 Views

Hi, 

 

Yes it is possible. You will need a kernel of type task. There is some information about that in the best practices guide (https://www.altera.com/content/dam/altera-www/global/en_us/pdfs/literature/hb/opencl-sdk/aocl_optimi...). Search for "Single Work-Item Execution" and it should get you to the section highlighting the differences with an NDRange kernel. 

 

Let us know if you need more information.
0 Kudos
Highlighted
Honored Contributor I
8 Views

Thank you for the reply. 

I tried and it's fine. I have two more questions: 

- is it possible to retrieve the number of available packets inside a pipe (or a channel)? 

- Is it possible to have a pipe (or channel) shared between the host and the kernel? In other words, to send data from the host to the device (or in the other sense using a second pipe/channel) in a stream way? 

Thanks!
0 Kudos
Highlighted
Honored Contributor I
8 Views

1- No, Altera doesn't provide any means for that. If you are using blocking channels and try to read from an empty channel (or write to one that is full), your kernel will stall. You have to make sure the sender and receiver read and write the same number of values to avoid stalls. The behavior and usage of the channels is extensively discussed in the Programming Guide and Best Practices Guide. 

 

2- Yes, v16.1 has beta support for host channels but it is not available publicly, you should contact Altera for that. Your BSP should also have support for such channels.
0 Kudos