Hmmm... I don't see anything strange according to the Spec. 3.0, section 2.5.1 (you may take a look at the Spec too). The inner loop would have problems, (from the Spec):
for (init-expr; test-expr; incr-expr) structured-block
init-expr One of the following:
var = lb
integer-type var = lb
random-access-iterator-type var = lb
pointer-type var = lb
test-expr One of the following:
var relational-op b
b relational-op var
incr-expr One of the following:
var += incr
var -= incr
var = var + incr
var = incr + var
var = var - incr
var One of the following:
A variable of a signed or unsigned integer type.
For C++, a variable of a random access iterator type.
For C, a variable of a pointer type.
If this variable would otherwise be shared, it is implicitly made
private in the loop construct. This variable must not be
modified during the execution of the for-loop other than in increxpr.
Unless the variable is specified lastprivate on the
loop construct, its value after the loop is unspecified.
but you are not trying to parallelize the inner loop... just in case you can try with
- Code: Select all
for(std::size_t j=0; j < (p_size-i); ++j)
and I will not be of much more help, sorry.