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
193 lines
8.6 KiB
Fortran
193 lines
8.6 KiB
Fortran
!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | FileCheck %s
|
|
!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -fopenmp-is-target-device %s -o - | FileCheck %s --check-prefix=DEVICE
|
|
!RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | FileCheck %s
|
|
!RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=52 -fopenmp-is-target-device %s -o - | FileCheck %s --check-prefix=DEVICE
|
|
|
|
! CHECK-LABEL: func.func @_QPimplicitly_captured_twice
|
|
! CHECK-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>{{.*}}}
|
|
function implicitly_captured_twice() result(k)
|
|
integer :: i
|
|
i = 10
|
|
k = i
|
|
end function implicitly_captured_twice
|
|
|
|
! CHECK-LABEL: func.func @_QPtarget_function_twice_host
|
|
! CHECK-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter), automap = false>{{.*}}}
|
|
function target_function_twice_host() result(i)
|
|
!$omp declare target enter(target_function_twice_host) device_type(host)
|
|
integer :: i
|
|
i = implicitly_captured_twice()
|
|
end function target_function_twice_host
|
|
|
|
! DEVICE-LABEL: func.func @_QPtarget_function_twice_device
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
function target_function_twice_device() result(i)
|
|
!$omp declare target enter(target_function_twice_device) device_type(nohost)
|
|
integer :: i
|
|
i = implicitly_captured_twice()
|
|
end function target_function_twice_device
|
|
|
|
!! -----
|
|
|
|
! DEVICE-LABEL: func.func @_QPimplicitly_captured_nest
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
function implicitly_captured_nest() result(k)
|
|
integer :: i
|
|
i = 10
|
|
k = i
|
|
end function implicitly_captured_nest
|
|
|
|
! DEVICE-LABEL: func.func @_QPimplicitly_captured_one
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter){{.*}}}
|
|
function implicitly_captured_one() result(k)
|
|
k = implicitly_captured_nest()
|
|
end function implicitly_captured_one
|
|
|
|
! DEVICE-LABEL: func.func @_QPimplicitly_captured_two
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
function implicitly_captured_two() result(k)
|
|
integer :: i
|
|
i = 10
|
|
k = i
|
|
end function implicitly_captured_two
|
|
|
|
! DEVICE-LABEL: func.func @_QPtarget_function_test
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
function target_function_test() result(j)
|
|
!$omp declare target enter(target_function_test) device_type(nohost)
|
|
integer :: i, j
|
|
i = implicitly_captured_one()
|
|
j = implicitly_captured_two() + i
|
|
end function target_function_test
|
|
|
|
!! -----
|
|
|
|
! CHECK-LABEL: func.func @_QPimplicitly_captured_nest_twice
|
|
! CHECK-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>{{.*}}}
|
|
function implicitly_captured_nest_twice() result(k)
|
|
integer :: i
|
|
i = 10
|
|
k = i
|
|
end function implicitly_captured_nest_twice
|
|
|
|
! CHECK-LABEL: func.func @_QPimplicitly_captured_one_twice
|
|
! CHECK-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>{{.*}}}
|
|
function implicitly_captured_one_twice() result(k)
|
|
k = implicitly_captured_nest_twice()
|
|
end function implicitly_captured_one_twice
|
|
|
|
! CHECK-LABEL: func.func @_QPimplicitly_captured_two_twice
|
|
! CHECK-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>{{.*}}}
|
|
function implicitly_captured_two_twice() result(k)
|
|
integer :: i
|
|
i = 10
|
|
k = i
|
|
end function implicitly_captured_two_twice
|
|
|
|
! DEVICE-LABEL: func.func @_QPtarget_function_test_device
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
function target_function_test_device() result(j)
|
|
!$omp declare target enter(target_function_test_device) device_type(nohost)
|
|
integer :: i, j
|
|
i = implicitly_captured_one_twice()
|
|
j = implicitly_captured_two_twice() + i
|
|
end function target_function_test_device
|
|
|
|
! CHECK-LABEL: func.func @_QPtarget_function_test_host
|
|
! CHECK-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter), automap = false>{{.*}}}
|
|
function target_function_test_host() result(j)
|
|
!$omp declare target enter(target_function_test_host) device_type(host)
|
|
integer :: i, j
|
|
i = implicitly_captured_one_twice()
|
|
j = implicitly_captured_two_twice() + i
|
|
end function target_function_test_host
|
|
|
|
!! -----
|
|
|
|
! DEVICE-LABEL: func.func @_QPimplicitly_captured_with_dev_type_recursive
|
|
! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>{{.*}}}
|
|
recursive function implicitly_captured_with_dev_type_recursive(increment) result(k)
|
|
!$omp declare target enter(implicitly_captured_with_dev_type_recursive) device_type(host)
|
|
integer :: increment, k
|
|
if (increment == 10) then
|
|
k = increment
|
|
else
|
|
k = implicitly_captured_with_dev_type_recursive(increment + 1)
|
|
end if
|
|
end function implicitly_captured_with_dev_type_recursive
|
|
|
|
! DEVICE-LABEL: func.func @_QPtarget_function_with_dev_type_recurse
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
function target_function_with_dev_type_recurse() result(i)
|
|
!$omp declare target enter(target_function_with_dev_type_recurse) device_type(nohost)
|
|
integer :: i
|
|
i = implicitly_captured_with_dev_type_recursive(0)
|
|
end function target_function_with_dev_type_recurse
|
|
|
|
!! -----
|
|
|
|
module test_module
|
|
contains
|
|
! CHECK-LABEL: func.func @_QMtest_modulePimplicitly_captured_nest_twice
|
|
! CHECK-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>{{.*}}}
|
|
function implicitly_captured_nest_twice() result(i)
|
|
integer :: i
|
|
i = 10
|
|
end function implicitly_captured_nest_twice
|
|
|
|
! CHECK-LABEL: func.func @_QMtest_modulePimplicitly_captured_one_twice
|
|
! CHECK-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>{{.*}}}
|
|
function implicitly_captured_one_twice() result(k)
|
|
!$omp declare target enter(implicitly_captured_one_twice) device_type(host)
|
|
k = implicitly_captured_nest_twice()
|
|
end function implicitly_captured_one_twice
|
|
|
|
! DEVICE-LABEL: func.func @_QMtest_modulePimplicitly_captured_two_twice
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
function implicitly_captured_two_twice() result(y)
|
|
integer :: y
|
|
y = 5
|
|
end function implicitly_captured_two_twice
|
|
|
|
! DEVICE-LABEL: func.func @_QMtest_modulePtarget_function_test_device
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
function target_function_test_device() result(j)
|
|
!$omp declare target enter(target_function_test_device) device_type(nohost)
|
|
integer :: i, j
|
|
i = implicitly_captured_one_twice()
|
|
j = implicitly_captured_two_twice() + i
|
|
end function target_function_test_device
|
|
end module test_module
|
|
|
|
!! -----
|
|
|
|
program mb
|
|
interface
|
|
subroutine caller_recursive
|
|
!$omp declare target enter(caller_recursive) device_type(nohost)
|
|
end subroutine
|
|
|
|
recursive subroutine implicitly_captured_recursive(increment)
|
|
integer :: increment
|
|
end subroutine
|
|
end interface
|
|
end program
|
|
|
|
! DEVICE-LABEL: func.func @_QPimplicitly_captured_recursive
|
|
! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
recursive subroutine implicitly_captured_recursive(increment)
|
|
integer :: increment
|
|
if (increment == 10) then
|
|
return
|
|
else
|
|
call implicitly_captured_recursive(increment + 1)
|
|
end if
|
|
end subroutine
|
|
|
|
! DEVICE-LABEL: func.func @_QPcaller_recursive
|
|
! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>{{.*}}}
|
|
subroutine caller_recursive
|
|
!$omp declare target enter(caller_recursive) device_type(nohost)
|
|
call implicitly_captured_recursive(0)
|
|
end subroutine
|