Files
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

83 lines
2.2 KiB
Fortran

! The predefined identifiers omp_initial_device (-1) and omp_invalid_device
! (-2) from the OpenMP 5.2+ specification must be accepted as valid device
! numbers in the DEVICE clause of target constructs.
! REQUIRES: openmp_runtime
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=52
! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=60
program main
use omp_lib
real(8) :: arrayA(256)
integer :: N, dev
arrayA = 1.414d0
N = 256
! Literal values allowed by the OpenMP 5.2 / 6.0 specification.
!$omp target device(-1)
do i = 1, N
arrayA(i) = 3.14d0
enddo
!$omp end target
!$omp target device(-2)
do i = 1, N
arrayA(i) = 3.14d0
enddo
!$omp end target
!$omp target device(0)
do i = 1, N
arrayA(i) = 3.14d0
enddo
!$omp end target
! Using the predefined identifiers from the omp_lib module.
!$omp target device(omp_initial_device)
do i = 1, N
arrayA(i) = 3.14d0
enddo
!$omp end target
!$omp target device(omp_invalid_device)
do i = 1, N
arrayA(i) = 3.14d0
enddo
!$omp end target
! Also accepted on target data and its data motion variants.
!$omp target data map(to: arrayA) device(omp_initial_device)
!$omp end target data
!$omp target data map(to: arrayA) device(omp_invalid_device)
!$omp end target data
!$omp target enter data map(alloc: arrayA) device(omp_initial_device)
!$omp target enter data map(alloc: arrayA) device(omp_invalid_device)
!$omp target exit data map(delete: arrayA) device(omp_initial_device)
!$omp target exit data map(delete: arrayA) device(omp_invalid_device)
!$omp target update to(arrayA) device(omp_initial_device)
!$omp target update to(arrayA) device(omp_invalid_device)
! Runtime-determined values pass the semantic check.
dev = -1
!$omp target device(dev)
do i = 1, N
arrayA(i) = 3.14d0
enddo
!$omp end target
! Values below -2 are still rejected.
!ERROR: The device expression of the DEVICE clause must be a non-negative integer expression, 'omp_initial_device' (-1), or 'omp_invalid_device' (-2)
!$omp target device(-3)
do i = 1, N
arrayA(i) = 3.14d0
enddo
!$omp end target
end program main