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
124 lines
4.3 KiB
Fortran
124 lines
4.3 KiB
Fortran
! This test checks lowering of OpenMP DO SIMD composite constructs.
|
|
|
|
! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s
|
|
! RUN: %flang_fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s
|
|
|
|
! CHECK-LABEL: func.func @_QPdo_simd_aligned(
|
|
subroutine do_simd_aligned(A)
|
|
use iso_c_binding
|
|
type(c_ptr) :: A
|
|
|
|
! CHECK: omp.wsloop
|
|
! CHECK-NOT: aligned({{.*}})
|
|
! CHECK-SAME: {
|
|
! CHECK-NEXT: omp.simd
|
|
! CHECK-SAME: aligned({{.*}})
|
|
!$omp do simd aligned(A:256)
|
|
do index_ = 1, 10
|
|
call c_test_call(A)
|
|
end do
|
|
!$omp end do simd
|
|
end subroutine do_simd_aligned
|
|
|
|
! CHECK-LABEL: func.func @_QPdo_simd_safelen(
|
|
subroutine do_simd_safelen()
|
|
! CHECK: omp.wsloop
|
|
! CHECK-NOT: safelen({{.*}})
|
|
! CHECK-SAME: {
|
|
! CHECK-NEXT: omp.simd
|
|
! CHECK-SAME: safelen({{.*}})
|
|
!$omp do simd safelen(4)
|
|
do index_ = 1, 10
|
|
end do
|
|
!$omp end do simd
|
|
end subroutine do_simd_safelen
|
|
|
|
! CHECK-LABEL: func.func @_QPdo_simd_simdlen(
|
|
subroutine do_simd_simdlen()
|
|
! CHECK: omp.wsloop
|
|
! CHECK-NOT: simdlen({{.*}})
|
|
! CHECK-SAME: {
|
|
! CHECK-NEXT: omp.simd
|
|
! CHECK-SAME: simdlen({{.*}})
|
|
!$omp do simd simdlen(4)
|
|
do index_ = 1, 10
|
|
end do
|
|
!$omp end do simd
|
|
end subroutine do_simd_simdlen
|
|
|
|
! CHECK-LABEL: func.func @_QPdo_simd_reduction(
|
|
subroutine do_simd_reduction()
|
|
integer :: sum
|
|
sum = 0
|
|
! CHECK: omp.wsloop
|
|
! CHECK-SAME: reduction(@[[RED_SYM:.*]] %{{.*}} -> %[[RED_OUTER:.*]] : !fir.ref<i32>)
|
|
! CHECK-NEXT: omp.simd
|
|
! CHECK-SAME: reduction(@[[RED_SYM]] %[[RED_OUTER]] -> %[[RED_INNER:.*]] : !fir.ref<i32>)
|
|
! CHECK-NEXT: omp.loop_nest
|
|
! CHECK: %[[RED_DECL:.*]]:2 = hlfir.declare %[[RED_INNER]]
|
|
! CHECK: %[[RED:.*]] = fir.load %[[RED_DECL]]#0 : !fir.ref<i32>
|
|
! CHECK: %[[RESULT:.*]] = arith.addi %[[RED]], %{{.*}} : i32
|
|
! CHECK: hlfir.assign %[[RESULT]] to %[[RED_DECL]]#0 : i32, !fir.ref<i32>
|
|
! CHECK-NEXT: omp.yield
|
|
!$omp do simd reduction(+:sum)
|
|
do index_ = 1, 10
|
|
sum = sum + 1
|
|
end do
|
|
!$omp end do simd
|
|
end subroutine do_simd_reduction
|
|
|
|
! Verify that the simd reduction var references the wsloop's reduction
|
|
! block arg (not the original array), ensuring proper chaining of
|
|
! per-SIMD-lane results into the wsloop's thread-private reduction copy.
|
|
! CHECK-LABEL: {{.*}}do_simd_array_reduction{{.*}}
|
|
subroutine do_simd_array_reduction()
|
|
integer :: a(100)
|
|
a = 0
|
|
! CHECK: omp.wsloop
|
|
! CHECK-SAME: reduction(byref @[[ADD_RED_SYM:.*]] %{{.*}} -> %[[ADD_RED_OUTER:.*]] : !fir.ref<!fir.box<!fir.array<100xi32>>>)
|
|
! CHECK-NEXT: omp.simd
|
|
! CHECK-SAME: reduction(byref @[[ADD_RED_SYM]] %[[ADD_RED_OUTER]] -> %[[ADD_RED_INNER:.*]] : !fir.ref<!fir.box<!fir.array<100xi32>>>)
|
|
! CHECK-NEXT: omp.loop_nest
|
|
!$omp do simd reduction(+:a)
|
|
do index_ = 1, 10
|
|
a = a + index_
|
|
end do
|
|
!$omp end do simd
|
|
end subroutine do_simd_array_reduction
|
|
|
|
! CHECK-LABEL: func.func @_QPdo_simd_private(
|
|
subroutine do_simd_private()
|
|
integer, allocatable :: tmp
|
|
! CHECK: %[[I_DECL:.*]]:2 = hlfir.declare %{{.*}} {uniq_name = "_QFdo_simd_privateEi"}
|
|
! CHECK: omp.wsloop
|
|
! CHECK-NEXT: omp.simd
|
|
! CHECK-SAME: private(@[[PRIV_BOX_SYM:.*]] %{{.*}} -> %[[PRIV_BOX:.*]] : !fir.ref<!fir.box<!fir.heap<i32>>>)
|
|
! CHECK-NEXT: omp.loop_nest (%[[IVAR:.*]]) : i32
|
|
!$omp do simd private(tmp)
|
|
do i=1, 10
|
|
! CHECK: %[[PRIV_BOX_DECL:.*]]:2 = hlfir.declare %[[PRIV_BOX]]
|
|
! CHECK: hlfir.assign %[[IVAR]] to %[[I_DECL]]#0
|
|
! CHECK: %[[PRIV_BOX_LOAD:.*]] = fir.load %[[PRIV_BOX_DECL]]
|
|
! CHECK: hlfir.assign %{{.*}} to %[[PRIV_BOX_DECL]]#0
|
|
! CHECK: omp.yield
|
|
tmp = tmp + 1
|
|
end do
|
|
end subroutine do_simd_private
|
|
|
|
! CHECK-LABEL: func.func @_QPdo_simd_lastprivate_firstprivate(
|
|
subroutine do_simd_lastprivate_firstprivate()
|
|
integer :: a
|
|
! CHECK: omp.wsloop
|
|
! CHECK-SAME: private(@[[FIRSTPRIVATE_A_SYM:.*]] %{{.*}} -> %[[FIRSTPRIVATE_A:.*]] : !fir.ref<i32>)
|
|
! CHECK-NEXT: omp.simd
|
|
! CHECK-SAME: linear({{.*}}#0 : !fir.ref<i32> = %{{[^:]*}} : i32)
|
|
! CHECK-SAME: private(@[[PRIVATE_A_SYM:.*]] %{{.*}} -> %[[PRIVATE_A:.*]] : !fir.ref<i32>)
|
|
!$omp do simd lastprivate(a) firstprivate(a)
|
|
do i = 1, 10
|
|
! CHECK: %[[FIRSTPRIVATE_A_DECL:.*]]:2 = hlfir.declare %[[FIRSTPRIVATE_A]]
|
|
! CHECK: %[[PRIVATE_A_DECL:.*]]:2 = hlfir.declare %[[PRIVATE_A]]
|
|
a = a + 1
|
|
end do
|
|
!$omp end do simd
|
|
end subroutine do_simd_lastprivate_firstprivate
|