# Conditional loop

Hello!

Here is a part of “acc kernels” section:

``````1164           IF (variable /= 'u' .and. variable /= 'x' ) THEN
1165             DO j = jts-bdyzone, MIN(jte,jde+jstag)+bdyzone
1166             DO k = kts, k_end
1167               dat(ide ,k,j) = dat(ide-1,k,j)
1168               dat(ide+1,k,j) = dat(ide-1,k,j)
1169               dat(ide+2,k,j) = dat(ide-1,k,j)
1170             ENDDO
1171             ENDDO
1172           ELSE
1173             DO j = MAX(jds,jts-1)-bdyzone, MIN(jte+1,jde+jstag)+bdyzone
1174             DO k = kts, k_end
1175               dat(ide+1,k,j) = dat(ide,k,j)
1176               dat(ide+2,k,j) = dat(ide,k,j)
1177               dat(ide+3,k,j) = dat(ide,k,j)
1178             ENDDO
1179             ENDDO
1180           END IF
``````

There is no outer loop for the above mentioned loops.

Compiler tells that:

``````   1165, Conditional loop will be executed in scalar mode
Accelerator kernel generated
1173, Conditional loop will be executed in scalar mode
Accelerator kernel generated
``````

I used PGI 13.9 and 13.10

What does it means? How can I solve it?

Alexey

Hi Alexey,

Interesting. I was able to reproduce the error here. Looks like a problem with a character data being used as the IF conditional variable. If you change this to be a logical or integer, then the two loops will get accelerated. Another work around would be to accelerate each loop individually by using a “!\$acc kernels loop” directive.

I’ve added a problem report (TPR#19689) and sent it on to engineering.

Thanks,
Mat

Thank you Mat!

In my case it would be easier to move “acc kernels” inside IFs