|
10 | 10 | // UNSUPPORTED: x86_64-pc-linux-gnu
|
11 | 11 | // UNSUPPORTED: x86_64-pc-linux-gnu-LTO
|
12 | 12 |
|
| 13 | +// clang-format on |
13 | 14 | int main() {
|
14 | 15 | int n = 1 << 20;
|
15 | 16 | int th = 12;
|
16 | 17 | int te = n / th;
|
| 18 | + |
17 | 19 | // DEFAULT: 12 (MaxFlatWorkGroupSize:
|
18 | 20 | #pragma omp target
|
19 | 21 | #pragma omp teams loop num_teams(te), thread_limit(th)
|
20 | 22 | for (int i = 0; i < n; i++) {
|
21 | 23 | }
|
22 | 24 |
|
23 |
| -// DEFAULT: 13 (MaxFlatWorkGroupSize: |
24 |
| - #pragma omp target |
25 |
| - #pragma omp teams distribute parallel for simd num_teams(te), thread_limit(th+1) simdlen(64) |
| 25 | +// DEFAULT: 13 (MaxFlatWorkGroupSize: |
| 26 | +#pragma omp target |
| 27 | +#pragma omp teams distribute parallel for simd num_teams(te), \ |
| 28 | + thread_limit(th + 1) simdlen(64) |
26 | 29 | for(int i = 0; i < n; i++) {
|
27 | 30 | }
|
| 31 | + |
| 32 | +// DEFAULT: 128 (MaxFlatWorkGroupSize: |
| 33 | +#pragma omp target teams distribute parallel for thread_limit(128) |
| 34 | + for (int i = 0; i < n; i++) { |
| 35 | + } |
| 36 | + |
| 37 | +// DEFAULT: 512 (MaxFlatWorkGroupSize: |
| 38 | +#pragma omp target teams distribute parallel for thread_limit(512) |
| 39 | + for (int i = 0; i < n; i++) { |
| 40 | + } |
| 41 | + |
| 42 | +// DEFAULT: 1024 (MaxFlatWorkGroupSize: |
| 43 | +#pragma omp target teams distribute parallel for thread_limit(1024) |
| 44 | + for (int i = 0; i < n; i++) { |
| 45 | + } |
| 46 | + |
| 47 | +// DEFAULT: 128 (MaxFlatWorkGroupSize: |
| 48 | +#pragma omp target teams distribute parallel for num_threads(128) |
| 49 | + for (int i = 0; i < n; i++) { |
| 50 | + } |
| 51 | + |
| 52 | +// DEFAULT: 512 (MaxFlatWorkGroupSize: |
| 53 | +#pragma omp target teams distribute parallel for num_threads(512) |
| 54 | + for (int i = 0; i < n; i++) { |
| 55 | + } |
| 56 | + |
| 57 | +// DEFAULT: 1024 (MaxFlatWorkGroupSize: |
| 58 | +#pragma omp target teams distribute parallel for num_threads(1024) |
| 59 | + for (int i = 0; i < n; i++) { |
| 60 | + } |
| 61 | + |
| 62 | +// DEFAULT: 64 (MaxFlatWorkGroupSize: |
| 63 | +#pragma omp target teams distribute parallel for thread_limit(64) \ |
| 64 | + num_threads(128) |
| 65 | + for (int i = 0; i < n; i++) { |
| 66 | + } |
| 67 | + |
| 68 | +// DEFAULT: 64 (MaxFlatWorkGroupSize: |
| 69 | +#pragma omp target teams distribute parallel for thread_limit(128) \ |
| 70 | + num_threads(64) |
| 71 | + for (int i = 0; i < n; i++) { |
| 72 | + } |
| 73 | + |
| 74 | +// DEFAULT: 512 (MaxFlatWorkGroupSize: |
| 75 | +#pragma omp target teams distribute parallel for thread_limit(512) \ |
| 76 | + num_threads(1024) |
| 77 | + for (int i = 0; i < n; i++) { |
| 78 | + } |
| 79 | + |
| 80 | +// DEFAULT: 512 (MaxFlatWorkGroupSize: |
| 81 | +#pragma omp target teams distribute parallel for thread_limit(1024) \ |
| 82 | + num_threads(512) |
| 83 | + for (int i = 0; i < n; i++) { |
| 84 | + } |
| 85 | + |
28 | 86 | return 0;
|
29 | 87 | }
|
0 commit comments