1 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-ppc-host.bc
2 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
3 // RUN: %clang_cc1 -target-cpu gfx900 -fopenmp -x c++ -std=c++11 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
4 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fopenmp-targets=nvptx64 -emit-llvm-bc %s -o %t-ppc-host.bc
5 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple nvptx64 -fopenmp-targets=nvptx64 -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
6 // RUN: %clang_cc1 -target-cpu sm_80 -fopenmp -x c++ -std=c++11 -triple nvptx64 -fopenmp-targets=nvptx64 -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s
8 // expected-no-diagnostics
15 void default_val_num_teams() {
16 #pragma omp target simd
17 for (int i
= 0; i
< 22; i
++)
22 #pragma omp target teams num_teams(22)
27 #pragma omp target teams distribute num_teams(22)
28 for (int i
= 0; i
< 22; i
++)
33 #pragma omp target teams distribute parallel for num_teams(22)
34 for (int i
= 0; i
< 22; i
++)
39 #pragma omp target teams num_teams(22)
44 #pragma omp target teams distribute num_teams(33)
45 for (int i
= 0; i
< 22; i
++)
50 #pragma omp target teams distribute parallel for num_teams(44)
51 for (int i
= 0; i
< 22; i
++)
57 #pragma omp target teams num_teams(NT)
62 #pragma omp target teams thread_limit(22)
67 #pragma omp target teams distribute parallel for thread_limit(22) num_threads(11)
68 for (int i
= 0; i
< 22; i
++)
72 void threads_and_teams() {
73 #pragma omp target teams distribute parallel for thread_limit(22) num_teams(33)
74 for (int i
= 0; i
< 22; i
++)
81 // CHECK: "omp_target_num_teams"="1"
82 // CHECK: "omp_target_num_teams"="22"
83 // CHECK: "omp_target_num_teams"="33"
84 // CHECK: "omp_target_num_teams"="44"
86 // CHECK: "omp_target_thread_limit"="22"
88 // CHECK: "omp_target_thread_limit"="11"
90 // CHECK: "omp_target_num_teams"="33"
91 // CHECK-SAME: "omp_target_thread_limit"="22"