Page 1 of 1

OpenMP Examples 4.0.2 : declare simd inbranch (SIMD7)

Posted: Thu Jul 30, 2015 2:12 am
by Spreis
The comment for examples SIMD7 is inconsistent with the code of examples:

The comment at page 190 states:
1 In the code below, the function fib() is called in the main program and also recursively called in the
2 function fib() within an if condition. The compiler creates a masked vector version and a
3 non-masked vector version for the function fib() while retaining the original scalar version of the
4 fib() function.
However both C and Fortran code list 'inbranch' clause which explicitly prevents non-masked vector version according to p. 2.8.2. of OpenMP 4.0 spec.

Code: Select all

S-7 #pragma omp declare simd inbranch
S-8 int fib( int n )

Code: Select all

S-22 recursive function fib(n) result(r)
S-23 !$omp declare simd(fib) inbranch