Is there any difference between #pragma unroll(0) and #pragma unroll(1)?

459 Views Asked by At

I read the document about the loop unrolling. It explains that if you set unrolling factor as 1, then the program will work like with #pragma nounrolling.

However, that documents does not include #pragma unroll(0) case.. Since the range of n is 0 to 255, I'm just wondering out of curiosity there is any difference between #pragma unroll(0) and #pragma unroll(1) cases.

I'm using C with icc compiler.

1

There are 1 best solutions below

0
static_cast On

From the Intel documentation:

The compiler generates correct code by comparing n and the loop count.

Based on that, I would make an assumption there is no difference between #pragma unroll(0) and #pragma unroll(1) as the the code generated would be equivalent.