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
134 lines
5.0 KiB
Fortran
134 lines
5.0 KiB
Fortran
! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=51
|
|
|
|
subroutine defaultmap_all_none_no_errors
|
|
implicit none
|
|
real :: array(10)
|
|
integer, pointer :: ptr(:)
|
|
real, allocatable :: alloca
|
|
integer :: index
|
|
|
|
!$omp target defaultmap(none) map(to: index, alloca) map(tofrom: array, ptr)
|
|
do index = 1, 10
|
|
ptr(index) = array(index) + alloca
|
|
end do
|
|
!$omp end target
|
|
end subroutine defaultmap_all_none_no_errors
|
|
|
|
subroutine defaultmap_all_none
|
|
implicit none
|
|
real :: array(10)
|
|
integer, pointer :: ptr(:)
|
|
real, allocatable :: alloca
|
|
integer :: index
|
|
!$omp target defaultmap(none)
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
do index = 1, 10
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'ptr' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'array' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'alloca' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
ptr(index) = array(index) + alloca
|
|
end do
|
|
!$omp end target
|
|
end subroutine defaultmap_all_none
|
|
|
|
subroutine defaultmap_scalar_none
|
|
implicit none
|
|
real :: array(10)
|
|
integer, pointer :: ptr(:)
|
|
real, allocatable :: alloca
|
|
integer :: index
|
|
|
|
!$omp target defaultmap(none: scalar)
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
do index = 1, 10
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'index' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
ptr(index) = array(index) + alloca
|
|
end do
|
|
!$omp end target
|
|
end subroutine defaultmap_scalar_none
|
|
|
|
subroutine defaultmap_pointer_none
|
|
implicit none
|
|
real :: array(10)
|
|
integer, pointer :: ptr(:)
|
|
real, allocatable :: alloca
|
|
integer :: index
|
|
|
|
!$omp target defaultmap(none: pointer)
|
|
do index = 1, 10
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'ptr' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
ptr(index) = array(index) + alloca
|
|
end do
|
|
!$omp end target
|
|
end subroutine defaultmap_pointer_none
|
|
|
|
subroutine defaultmap_allocatable_none
|
|
implicit none
|
|
real :: array(10)
|
|
integer, pointer :: ptr(:)
|
|
real, allocatable :: alloca
|
|
integer :: index
|
|
|
|
!$omp target defaultmap(none: allocatable)
|
|
do index = 1, 10
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'alloca' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
ptr(index) = array(index) + alloca
|
|
end do
|
|
!$omp end target
|
|
end subroutine defaultmap_allocatable_none
|
|
|
|
subroutine defaultmap_aggregate_none
|
|
implicit none
|
|
real :: array(10)
|
|
integer, pointer :: ptr(:)
|
|
real, allocatable :: alloca
|
|
integer :: index
|
|
|
|
!$omp target defaultmap(none: aggregate)
|
|
do index = 1, 10
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'array' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
ptr(index) = array(index) + alloca
|
|
end do
|
|
!$omp end target
|
|
end subroutine defaultmap_aggregate_none
|
|
|
|
! Verify we do not catch null in defaultmap(none)
|
|
subroutine defaultmap_builtin_none
|
|
implicit none
|
|
integer, pointer :: ptr(:)
|
|
|
|
!$omp target defaultmap(none) map(ptr)
|
|
!CHECK-NOT: The DEFAULTMAP(NONE) clause requires that 'null' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
ptr => null()
|
|
!$omp end target
|
|
end subroutine defaultmap_builtin_none
|
|
|
|
module pro
|
|
implicit none
|
|
contains
|
|
|
|
function test_procedure() result(ret)
|
|
integer :: ret
|
|
ret = 1
|
|
end function test_procedure
|
|
|
|
! Verify we do not catch a function symbol in defaultmap(none)
|
|
! but do catch procedure pointers
|
|
subroutine defaultmap_func_and_procedure_pointer()
|
|
implicit none
|
|
procedure(test_procedure), pointer :: f1
|
|
integer :: i
|
|
|
|
f1 => test_procedure
|
|
|
|
!$omp target defaultmap(none) map(i)
|
|
!ERROR: The DEFAULTMAP(NONE) clause requires that 'f1' must be listed in a data-sharing attribute, data-mapping attribute, or is_device_ptr clause
|
|
i = f1()
|
|
i = test_procedure()
|
|
!$omp end target
|
|
end subroutine defaultmap_func_and_procedure_pointer
|
|
end module
|