4.4 #pragma unroll[(n)], #pragma unroll_completely
Instructs the compiler to unroll a loop by
is an optional value indicating the number of iterations to unroll.
If you do not specify a value for
, the compiler attempts to fully unroll
the loop. The compiler can only fully unroll loops where it can determine the number
#pragma unroll_completely is a
#pragma unroll with no iteration count
This pragma only has an effect with optimization level
-O2 and higher.
When compiling with
compiler automatically unrolls loops where it is beneficial to do so. You can use
this pragma to ask the compiler to unroll a loop that has not been unrolled
#pragma unroll[( can be used immediately before a
for loop, a
while loop, or a
This pragma is a request to the compiler to unroll a loop that has not been unrolled automatically. It does not guarantee that the loop is unrolled.