The conditional histogram kernel, described by the following code, is used as a benchmark to evaluate several dynamic schedulers and tools in the HLS area. This code is presented in this paper to evaluate their proposed dynamic-static hybrid scheduler.

#define N 1000
void cond_histogram(
					int    f[N], 
					double w[N], 
					double hist[N]) {
	for (int i=0; i<N; ++i) {
		double temp = w[i];
	    if (temp >= 0){
			double x = hist[f[i]];
			hist[f[i]] = x + temp;
		}
	}
}

If we synthesis this code using Vitis-HLS 2020.2, then the initiation interval of the for-loop would be 8, and the total kernel latency is 8004.

The question is, how can we improve the performance?

You can follow the solution in the following video.

 If you are interested in learning HLS to design digital systems, please refer to here.

If you are interested in learning HLS to design digital systems, please refer to here.