cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
232 Views
Registered: ‎10-15-2019

Kernels racing to termination

Jump to solution

Hi there,

I'm developing a kernel in SDAccel and I'm essentially racing multiple kernels to see who finds the solution first. I have a single kernel calling the racing kernels running in parallel with the dataflow directive. At the moment I have if statements below the kernels watching a 'complete' variable that each kernel updates independently.

#pragma HLS DATAFLOW
kernel(&complete1);
kernel(&complete2);
kernel(&complete3);
kernel(&complete4);
if(complete1==1){
return;
} else if(complete2==1){
return;
}else if(complete3==1){
return;
}else if(complete4==1){
return;
}

This code produces the schedule viewer in Vivado HLS. the four striped processes being the racing kernels.

cceev_1-1597001782250.png

I have tried the configuration shown below using a conditional while loop to monitor the processes, but this isn't supported with the DATAFLOW function.

while((complete1!=1)&&(complete2!=1)&&(complete3!=1)&&(complete4!=1)){
#pragma HLS DATAFLOW
kernel(&complete1);
kernel(&complete2);
kernel(&complete3);
kernel(&complete4);
}
if(complete1==1){
return;
} else if(complete2==1){
return;
}else if(complete3==1){
return;
}else if(complete4==1){
return;
}

My question is, how do I know that the program is terminating when one kernel finishes before the rest? Wont the program wait for the other kernels to terminate completely before stopping the host kernel? Is there a way to achieve this racing behavior?

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Contributor
Contributor
111 Views
Registered: ‎10-15-2019

The short answer is that the kernel will wait for the other kernels to complete before stopping the program. There is no way to do a kernel racing behavior.

https://forums.xilinx.com/t5/Vitis-Acceleration-SDAccel-SDSoC/Running-Multiple-Kernels/m-p/1138349

 

View solution in original post

0 Kudos
1 Reply
Highlighted
Contributor
Contributor
112 Views
Registered: ‎10-15-2019

The short answer is that the kernel will wait for the other kernels to complete before stopping the program. There is no way to do a kernel racing behavior.

https://forums.xilinx.com/t5/Vitis-Acceleration-SDAccel-SDSoC/Running-Multiple-Kernels/m-p/1138349

 

View solution in original post

0 Kudos