OpenMP Examples 4.0.2 : declare simd inbranch (SIMD7)

Discuss the OpenMP 4.0 Examples document.
Forum rules
The OpenMP Forums are now closed to new posts. Please visit Stack Overflow if you are in need of help: https://stackoverflow.com/questions/tagged/openmp
Locked
Spreis
Posts: 12
Joined: Tue Jul 14, 2015 9:35 am

OpenMP Examples 4.0.2 : declare simd inbranch (SIMD7)

Post 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 )
and

Code: Select all

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

Locked