CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
104 lines
3.1 KiB
C++
104 lines
3.1 KiB
C++
// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s
|
|
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s
|
|
// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -verify %s -ast-print | FileCheck %s
|
|
// expected-no-diagnostics
|
|
|
|
#ifndef HEADER
|
|
#define HEADER
|
|
|
|
void foo();
|
|
|
|
// CHECK-LABEL: void test_lower_upper_bound()
|
|
void test_lower_upper_bound() {
|
|
int lower = 2, upper = 8;
|
|
// CHECK: #pragma omp teams num_teams(2:8)
|
|
#pragma omp teams num_teams(2:8)
|
|
{ foo(); }
|
|
|
|
// CHECK: #pragma omp teams num_teams(lower:upper)
|
|
#pragma omp teams num_teams(lower:upper)
|
|
{ foo(); }
|
|
|
|
// CHECK: #pragma omp target teams num_teams(1:10)
|
|
#pragma omp target teams num_teams(1:10)
|
|
{ foo(); }
|
|
|
|
// CHECK: #pragma omp target teams distribute num_teams(3:6)
|
|
#pragma omp target teams distribute num_teams(3:6)
|
|
for (int i = 0; i < 100; ++i) { }
|
|
}
|
|
|
|
// CHECK-LABEL: void test_various_directives()
|
|
void test_various_directives() {
|
|
int lb = 4, ub = 12;
|
|
|
|
// CHECK: #pragma omp target teams distribute parallel for num_teams(lb:ub)
|
|
#pragma omp target teams distribute parallel for num_teams(lb:ub)
|
|
for (int i = 0; i < 100; ++i) { }
|
|
|
|
// CHECK: #pragma omp target teams distribute parallel for simd num_teams(2:16)
|
|
#pragma omp target teams distribute parallel for simd num_teams(2:16)
|
|
for (int i = 0; i < 100; ++i) { }
|
|
|
|
// CHECK: #pragma omp target teams distribute simd num_teams(1:8)
|
|
#pragma omp target teams distribute simd num_teams(1:8)
|
|
for (int i = 0; i < 100; ++i) { }
|
|
}
|
|
|
|
// CHECK-LABEL: void test_nested_expressions()
|
|
void test_nested_expressions() {
|
|
int arr[10][10];
|
|
int x = 5, y = 10;
|
|
|
|
// CHECK: #pragma omp teams num_teams(arr[0][0]:arr[1][1])
|
|
#pragma omp teams num_teams(arr[0][0]:arr[1][1])
|
|
{ foo(); }
|
|
|
|
// CHECK: #pragma omp teams num_teams(arr[x][0]:arr[y][1])
|
|
#pragma omp teams num_teams(arr[x][0]:arr[y][1])
|
|
{ foo(); }
|
|
|
|
// CHECK: #pragma omp teams num_teams((x + 1):(y - 1))
|
|
#pragma omp teams num_teams((x + 1):(y - 1))
|
|
{ foo(); }
|
|
|
|
}
|
|
|
|
// CHECK-LABEL: void test_multi_level_matching_delimiters()
|
|
void test_multi_level_matching_delimiters() {
|
|
int arr[10][10];
|
|
int x = 5, y = 10;
|
|
|
|
// CHECK: #pragma omp teams num_teams(((x + 1) * 2):((y - 1) * 3))
|
|
#pragma omp teams num_teams(((x + 1) * 2):((y - 1) * 3))
|
|
{ foo(); }
|
|
|
|
|
|
// CHECK: #pragma omp teams num_teams(arr[arr[0][0]][0]:arr[arr[1][1]][1])
|
|
#pragma omp teams num_teams(arr[arr[0][0]][0]:arr[arr[1][1]][1])
|
|
{ foo(); }
|
|
|
|
// CHECK: #pragma omp teams num_teams((arr[x][y] + 1):(arr[y][x] - 1))
|
|
#pragma omp teams num_teams((arr[x][y] + 1):(arr[y][x] - 1))
|
|
{ foo(); }
|
|
|
|
// CHECK: #pragma omp teams num_teams((x + (y * 2)):((x * 2) + y))
|
|
#pragma omp teams num_teams((x + (y * 2)):((x * 2) + y))
|
|
{ foo(); }
|
|
|
|
// CHECK: #pragma omp teams num_teams((arr[0][1] + arr[2][3]):(arr[4][5] + arr[6][7]))
|
|
#pragma omp teams num_teams((arr[0][1] + arr[2][3]):(arr[4][5] + arr[6][7]))
|
|
{ foo(); }
|
|
}
|
|
|
|
// Template tests
|
|
// CHECK-LABEL: template <typename T> void test_template_type(T lower, T upper)
|
|
template<typename T>
|
|
void test_template_type(T lower, T upper) {
|
|
// CHECK: #pragma omp teams num_teams(lower:upper)
|
|
#pragma omp teams num_teams(lower:upper)
|
|
{}
|
|
}
|
|
|
|
#endif
|