Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
867 Views

autorun kernels not starting in 16.x

Hi. 

 

When compiling a project with several autorun kernels on a 16.x version of the SDK the emulation will only start some them. 

On a 17.x SDK version all of them are started in emulation. 

 

All of them are single work items and declared as follows: 

__attribute__((max_global_work_dim(0))) __attribute__((autorun)) __kernel void ${NAME}() {...}  

 

Are there some constraints about the number or order of kernels I am not aware of? 

 

I have to use the 16.x SDK for the hardware platform my project runs on and I'm not sure if testing emulation on 17.x and then creating hardware with 16.x is the best way to handle this. 

 

Regards 

Julius Roob
0 Kudos
3 Replies
Altera_Forum
Honored Contributor I
41 Views

Emulation of autorun kernels is not properly supported in AOC up to v16.1.2. For emulation of such kernels in v16.1.2 and below, you have to create a separate queue and explicitly call the autorun kernel from the host (without any arguments). However, these kernels work correctly on the FPGA itself without needing to be called from the host. Even if the autorun kernel is replicated using num_compute_units, you only need to call it once in the host code for emulation. Note that even though such kernels will automatically restart on the FPGA if their execution finishes, this will not happen in the emulator, and if your code expects the kernel to restart automatically, you have to call it again in the host for emulation. What I do is that I add the necessary code for explicitly calling the autorun kernels during emulation in an "#ifdef EMULATION" block, and use the "EMULATION" variable at compile-time to control whether I want to compile for emulation or FPGA execution. 

 

I reported this discrepancy between emulation and FPGA execution to Altera a couple months ago, and they implemented a fix in v17.0; however, the fix is not complete since autorun kernels still do not restart on their own after their execution finishes. I have reported this remaining issue, too, and they will hopefully fix it in the upcoming versions.
Altera_Forum
Honored Contributor I
41 Views

That is a very helpful answer. 

 

Thank you.
DongWang-BJTU
New Contributor I
41 Views

I am using v18.1.0, still got the same problem. After a few rounds of restart, the autorun kernel never came back.

Reply