joverbey / oaccrefac

1 stars 1 forks source link

IntroDataConstruct won't surround an if statement appropriately #41

Closed acalvert closed 8 years ago

acalvert commented 8 years ago

When selecting all of

if (n) {
    for (j = 1; j < n; j++)
        a[j][i] = b[j][i] + 1;
} 

it yields

if (n)
#pragma acc data
    {   {
            for (j = 1; j < n; j++)
            a[j][i] = b[j][i] + 1;
        }} 
acalvert commented 8 years ago

Actually, this only occurs when the if statement has an else clause. It seems technically correct, but PGCC won't compile it.

acalvert commented 8 years ago

Added a check in IntroDataConstructCheck and added some unit tests covering the case.