86 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2! OpenMP Version 4.53! Various checks with the ordered construct4 5SUBROUTINE LINEAR_GOOD(N)6 INTEGER N, i, j, a, b(10)7 !$omp target8 !$omp teams9 !$omp distribute parallel do simd linear(i) 10 do i = 1, N11 a = 3.1412 enddo13 !$omp end distribute parallel do simd14 !$omp end teams15 !$omp end target16END SUBROUTINE LINEAR_GOOD17 18SUBROUTINE LINEAR_BAD(N)19 INTEGER N, i, j, a, b(10)20 21 !$omp target22 !$omp teams23 !ERROR: Variable 'j' not allowed in LINEAR clause, only loop iterator can be specified in LINEAR clause of a construct combined with DISTRIBUTE24 !$omp distribute parallel do simd linear(j) 25 do i = 1, N26 a = 3.1427 enddo28 !$omp end distribute parallel do simd29 !$omp end teams30 !$omp end target31 32 !$omp target33 !$omp teams34 !ERROR: Variable 'j' not allowed in LINEAR clause, only loop iterator can be specified in LINEAR clause of a construct combined with DISTRIBUTE35 !ERROR: Variable 'b' not allowed in LINEAR clause, only loop iterator can be specified in LINEAR clause of a construct combined with DISTRIBUTE36 !$omp distribute parallel do simd linear(j) linear(b)37 do i = 1, N38 a = 3.1439 enddo40 !$omp end distribute parallel do simd41 !$omp end teams42 !$omp end target 43 44 !$omp target45 !$omp teams46 !ERROR: Variable 'j' not allowed in LINEAR clause, only loop iterator can be specified in LINEAR clause of a construct combined with DISTRIBUTE47 !ERROR: Variable 'b' not allowed in LINEAR clause, only loop iterator can be specified in LINEAR clause of a construct combined with DISTRIBUTE48 !$omp distribute parallel do simd linear(j, b)49 do i = 1, N50 a = 3.1451 enddo52 !$omp end distribute parallel do simd53 !$omp end teams54 !$omp end target 55 56 !WARNING: `DISTRIBUTE` must be dynamically enclosed in a `TEAMS` region.57 !ERROR: Variable 'j' not allowed in LINEAR clause, only loop iterator can be specified in LINEAR clause of a construct combined with DISTRIBUTE58 !$omp distribute simd linear(i,j)59 do i = 1, N60 do j = 1, N61 a = 3.1462 enddo63 enddo64 !$omp end distribute simd65 66 !WARNING: `DISTRIBUTE` must be dynamically enclosed in a `TEAMS` region.67 !ERROR: Variable 'j' not allowed in LINEAR clause, only loop iterator can be specified in LINEAR clause of a construct combined with DISTRIBUTE68 !$omp distribute simd linear(i,j) collapse(1)69 do i = 1, N70 do j = 1, N71 a = 3.1472 enddo73 enddo74 !$omp end distribute simd75 76 !WARNING: `DISTRIBUTE` must be dynamically enclosed in a `TEAMS` region.77 !$omp distribute simd linear(i,j) collapse(2)78 do i = 1, N79 do j = 1, N80 a = 3.1481 enddo82 enddo83 !$omp end distribute simd84 85END SUBROUTINE LINEAR_BAD86