|
2 | 2 |
|
3 | 3 | // RUN: %clang_cc1 -verify -fopenmp-simd -triple x86_64-unknown-linux-gnu -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=DEFAULT |
4 | 4 |
|
5 | | -// RUN: %clang_cc1 -verify -fopenmp -triple amdgcn-amd-amdhsa -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=DEFAULT-AMDGCN |
| 5 | +// RUN: %clang_cc1 -verify -fopenmp -triple amdgcn-amd-amdhsa -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=DEFAULT-GPU |
6 | 6 |
|
7 | | -// RUN: %clang_cc1 -verify -fopenmp-simd -triple amdgcn-amd-amdhsa -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=DEFAULT-AMDGCN |
| 7 | +// RUN: %clang_cc1 -verify -fopenmp-simd -triple amdgcn-amd-amdhsa -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=DEFAULT-GPU |
| 8 | + |
| 9 | +// RUN: %clang_cc1 -verify -fopenmp -triple spirv64-intel -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=DEFAULT-GPU |
| 10 | + |
| 11 | +// RUN: %clang_cc1 -verify -fopenmp-simd -triple spirv64-intel -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=DEFAULT-GPU |
8 | 12 |
|
9 | 13 | // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=52 -DOMP52 -triple x86_64-unknown-linux-gnu -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=OMP52 |
10 | 14 |
|
11 | 15 | // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=52 -DOMP52 -triple x86_64-unknown-linux-gnu -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=OMP52 |
12 | 16 |
|
13 | | -// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=52 -DOMP52 -triple amdgcn-amd-amdhsa -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=OMP52-AMDGCN |
| 17 | +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=52 -DOMP52 -triple amdgcn-amd-amdhsa -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=OMP52-GPU |
| 18 | + |
| 19 | +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=52 -DOMP52 -triple amdgcn-amd-amdhsa -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=OMP52-GPU |
| 20 | + |
| 21 | +// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=52 -DOMP52 -triple spirv64-intel -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=OMP52-GPU |
14 | 22 |
|
15 | | -// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=52 -DOMP52 -triple amdgcn-amd-amdhsa -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=OMP52-AMDGCN |
| 23 | +// RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=52 -DOMP52 -triple spirv64-intel -x c -std=c99 -ast-print %s -o - | FileCheck %s --check-prefix=OMP52-GPU |
16 | 24 | // expected-no-diagnostics |
17 | 25 |
|
18 | 26 | #ifndef HEADER |
@@ -77,6 +85,12 @@ void foo1(void) { |
77 | 85 | for (int i = 0; i < 100; i++) |
78 | 86 | ; |
79 | 87 |
|
| 88 | +#pragma omp metadirective when(device={arch("spirv64")}: \ |
| 89 | + teams distribute parallel for)\ |
| 90 | + otherwise(parallel for) |
| 91 | + for (int i = 0; i < 100; i++) |
| 92 | + ; |
| 93 | + |
80 | 94 | #pragma omp metadirective when(implementation = {extension(match_all)} \ |
81 | 95 | : nothing) otherwise(parallel for) |
82 | 96 | for (int i = 0; i < 16; i++) |
@@ -134,8 +148,8 @@ void foo1(void) { |
134 | 148 | // OMP52-NEXT: for (int i = 0; i < 16; i++) { |
135 | 149 | // OMP52-NEXT: #pragma omp simd |
136 | 150 | // OMP52-NEXT: for (int j = 0; j < 16; j++) |
137 | | -// OMP52-AMDGCN: #pragma omp teams distribute parallel for |
138 | | -// OMP52-AMDGCN-NEXT: for (int i = 0; i < 100; i++) |
| 151 | +// OMP52-GPU: #pragma omp teams distribute parallel for |
| 152 | +// OMP52-GPU-NEXT: for (int i = 0; i < 100; i++) |
139 | 153 | // OMP52: for (int i = 0; i < 16; i++) |
140 | 154 | // OMP52: for (int i = 0; i < 16; i++) |
141 | 155 |
|
@@ -198,6 +212,12 @@ void foo2(void) { |
198 | 212 | for (int i = 0; i < 100; i++) |
199 | 213 | ; |
200 | 214 |
|
| 215 | +#pragma omp metadirective when(device={arch("spirv64")}: \ |
| 216 | + teams distribute parallel for)\ |
| 217 | + default(parallel for) |
| 218 | + for (int i = 0; i < 100; i++) |
| 219 | + ; |
| 220 | + |
201 | 221 | #pragma omp metadirective when(implementation = {extension(match_all)} \ |
202 | 222 | : nothing) default(parallel for) |
203 | 223 | for (int i = 0; i < 16; i++) |
@@ -266,8 +286,8 @@ void foo2(void) { |
266 | 286 | // DEFAULT-NEXT: for (int i = 0; i < 16; i++) { |
267 | 287 | // DEFAULT-NEXT: #pragma omp simd |
268 | 288 | // DEFAULT-NEXT: for (int j = 0; j < 16; j++) |
269 | | -// DEFAULT-AMDGCN: #pragma omp teams distribute parallel for |
270 | | -// DEFAULT-AMDGCN-NEXT: for (int i = 0; i < 100; i++) |
| 289 | +// DEFAULT-GPU: #pragma omp teams distribute parallel for |
| 290 | +// DEFAULT-GPU-NEXT: for (int i = 0; i < 100; i++) |
271 | 291 | // DEFAULT: for (int i = 0; i < 16; i++) |
272 | 292 | // DEFAULT: for (int i = 0; i < 16; i++) |
273 | 293 |
|
|
0 commit comments