Intel® High Level Synthesis Compiler Pro Edition: Reference Manual

ID 683349
Date 4/01/2024
Public
Document Table of Contents

6.9.2. Loop Fusion Exemption (nofusion pragma)

You can exempt a loop from being considered for fusing with an adjacent loop by annotating the loop with the nofusion pragma. This pragma prevents the annotated loop from being automatically fused or fused when it is subject to the loop_fuse pragma.

Specify the nofusion pragma as follows:
#pragma nofusion
for (...) {
loop body
}

Applying the nofusion pragma to one of the loops in a pair prevents the loops from being fused.

For example, the following code samples have the same effect. If one loop in a pair is annotated with the nofusion pragma, the other loop has no other loop to fuse with.
#pragma nofusion
L1: for (int j=0; j < N; ++j){
 data[j] += Q;
}
L2: for (int i = 0; i < N; ++l) {
 output[i] = Q * data[i];
}
L1: for (int j=0; j < N; ++j){
 data[j] += Q;
}
#pragma nofusion
L2: for (int i = 0; i < N; ++l) {
 output[i] = Q * data[i];
}
For another example of the effects of using the nofusion pragma, refer to the following tutorial:
<quartus_installdir>/hls/examples/tutorials/best_practices/loop_fusion