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
224 lines
6.1 KiB
Fortran
224 lines
6.1 KiB
Fortran
! Test lowering of OpenMP metadirective with implementation selectors.
|
|
|
|
! RUN: %flang_fc1 -fopenmp -emit-hlfir -fopenmp-version=50 %s -o - | FileCheck %s
|
|
! RUN: %flang_fc1 -fopenmp -emit-hlfir -fopenmp-version=51 %s -o - | FileCheck %s
|
|
! RUN: %flang_fc1 -fopenmp -emit-hlfir -fopenmp-version=52 -cpp -DOMP_52 %s -o - | FileCheck %s
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_vendor_llvm()
|
|
! CHECK: omp.taskwait
|
|
! CHECK: return
|
|
subroutine test_vendor_llvm()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor(amd)}: taskwait) &
|
|
#ifdef OMP_52
|
|
!$omp & otherwise(nothing)
|
|
#else
|
|
!$omp & default(nothing)
|
|
#endif
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_vendor_no_match()
|
|
! CHECK-NOT: omp.taskwait
|
|
! CHECK: return
|
|
subroutine test_vendor_no_match()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor("unknown")}: taskwait) &
|
|
#ifdef OMP_52
|
|
!$omp & otherwise(nothing)
|
|
#else
|
|
!$omp & default(nothing)
|
|
#endif
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_standalone_barrier_match()
|
|
! CHECK: omp.barrier
|
|
! CHECK: return
|
|
subroutine test_standalone_barrier_match()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor(amd)}: barrier) &
|
|
#ifdef OMP_52
|
|
!$omp & otherwise(nothing)
|
|
#else
|
|
!$omp & default(nothing)
|
|
#endif
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_standalone_barrier_fallback()
|
|
! CHECK: omp.barrier
|
|
! CHECK: return
|
|
subroutine test_standalone_barrier_fallback()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor("cray")}: nothing) &
|
|
#ifdef OMP_52
|
|
!$omp & otherwise(barrier)
|
|
#else
|
|
!$omp & default(barrier)
|
|
#endif
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_nothing_variant()
|
|
! CHECK-NOT: omp.taskwait
|
|
! CHECK: return
|
|
subroutine test_nothing_variant()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor(amd)}: nothing) &
|
|
#ifdef OMP_52
|
|
!$omp & otherwise(taskwait)
|
|
#else
|
|
!$omp & default(taskwait)
|
|
#endif
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_default_fallback()
|
|
! CHECK: omp.taskwait
|
|
! CHECK: return
|
|
subroutine test_default_fallback()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor("unknown")}: nothing) &
|
|
#ifdef OMP_52
|
|
!$omp & otherwise(taskwait)
|
|
#else
|
|
!$omp & default(taskwait)
|
|
#endif
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_no_default()
|
|
! CHECK-NOT: omp.taskyield
|
|
! CHECK: return
|
|
subroutine test_no_default()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor("gnu")}: taskyield)
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_multiple_when_first_match()
|
|
! CHECK: omp.taskwait
|
|
! CHECK-NOT: omp.taskyield
|
|
! CHECK: return
|
|
subroutine test_multiple_when_first_match()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor(amd)}: taskwait) &
|
|
!$omp & when(user={condition(.false.)}: taskyield) &
|
|
#ifdef OMP_52
|
|
!$omp & otherwise(nothing)
|
|
#else
|
|
!$omp & default(nothing)
|
|
#endif
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_multiple_when_fallback()
|
|
! CHECK-NOT: omp.taskyield
|
|
! CHECK: omp.taskwait
|
|
! CHECK: return
|
|
subroutine test_multiple_when_fallback()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor("nvidia")}: taskyield) &
|
|
!$omp & when(user={condition(.false.)}: taskyield) &
|
|
#ifdef OMP_52
|
|
!$omp & otherwise(taskwait)
|
|
#else
|
|
!$omp & default(taskwait)
|
|
#endif
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_implicit_nothing_tie_break()
|
|
! CHECK: omp.barrier
|
|
! CHECK: return
|
|
subroutine test_implicit_nothing_tie_break()
|
|
!$omp metadirective &
|
|
!$omp & when(implementation={vendor(amd)}:) &
|
|
!$omp & when(implementation={vendor(amd)}: barrier)
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_begin_vendor_llvm()
|
|
! CHECK: omp.parallel
|
|
! CHECK: omp.terminator
|
|
! CHECK: return
|
|
subroutine test_begin_vendor_llvm()
|
|
integer :: x
|
|
x = 0
|
|
#ifdef OMP_52
|
|
!$omp begin metadirective &
|
|
!$omp & when(implementation={vendor(amd)}: parallel) &
|
|
!$omp & otherwise(nothing)
|
|
#else
|
|
!$omp begin metadirective &
|
|
!$omp & when(implementation={vendor(amd)}: parallel)
|
|
#endif
|
|
x = 1
|
|
!$omp end metadirective
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_begin_vendor_no_match()
|
|
! CHECK-NOT: omp.parallel
|
|
! CHECK: return
|
|
subroutine test_begin_vendor_no_match()
|
|
integer :: x
|
|
x = 0
|
|
#ifdef OMP_52
|
|
!$omp begin metadirective &
|
|
!$omp & when(implementation={vendor("unknown")}: parallel) &
|
|
!$omp & otherwise(nothing)
|
|
#else
|
|
!$omp begin metadirective &
|
|
!$omp & when(implementation={vendor("unknown")}: parallel)
|
|
#endif
|
|
x = 1
|
|
!$omp end metadirective
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_begin_multiple_when_first_match()
|
|
! CHECK: omp.parallel
|
|
! CHECK: omp.terminator
|
|
! CHECK-NOT: omp.task
|
|
! CHECK: return
|
|
subroutine test_begin_multiple_when_first_match()
|
|
integer :: x
|
|
x = 0
|
|
#ifdef OMP_52
|
|
!$omp begin metadirective &
|
|
!$omp & when(implementation={vendor(amd)}: parallel) &
|
|
!$omp & when(user={condition(.false.)}: task) &
|
|
!$omp & otherwise(nothing)
|
|
#else
|
|
!$omp begin metadirective &
|
|
!$omp & when(implementation={vendor(amd)}: parallel) &
|
|
!$omp & when(user={condition(.false.)}: task)
|
|
#endif
|
|
x = 1
|
|
!$omp end metadirective
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_begin_implicit_nothing_tie_break()
|
|
! CHECK: omp.parallel
|
|
! CHECK: omp.terminator
|
|
! CHECK: return
|
|
subroutine test_begin_implicit_nothing_tie_break()
|
|
integer :: x
|
|
x = 0
|
|
!$omp begin metadirective &
|
|
!$omp & when(implementation={vendor(amd)}:) &
|
|
!$omp & when(implementation={vendor(amd)}: parallel)
|
|
x = 1
|
|
!$omp end metadirective
|
|
end subroutine
|
|
|
|
! CHECK-LABEL: func.func @_QPtest_begin_multiple_when_fallback()
|
|
! CHECK-NOT: omp.task
|
|
! CHECK: omp.parallel
|
|
! CHECK: omp.terminator
|
|
! CHECK: return
|
|
subroutine test_begin_multiple_when_fallback()
|
|
integer :: x
|
|
x = 0
|
|
!$omp begin metadirective &
|
|
!$omp & when(implementation={vendor("nvidia")}: task) &
|
|
!$omp & when(user={condition(.false.)}: task) &
|
|
#ifdef OMP_52
|
|
!$omp & otherwise(parallel)
|
|
#else
|
|
!$omp & default(parallel)
|
|
#endif
|
|
x = 1
|
|
!$omp end metadirective
|
|
end subroutine
|