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

99 lines
2.7 KiB
Fortran

! REQUIRES: flang
! REQUIRES: gpu
! RUN: %libomptarget-compile-fortran-generic -O3 -fopenmp-assume-threads-oversubscription -fopenmp-assume-teams-oversubscription
! RUN: env LIBOMPTARGET_INFO=16 OMP_NUM_TEAMS=16 OMP_TEAMS_THREAD_LIMIT=16 %libomptarget-run-generic 2>&1 | %fcheck-generic
! XFAIL: intelgpu
function check_errors(array) result (errors)
integer, intent(in) :: array(1024)
integer :: errors
integer :: i
errors = 0
do i = 1, 1024
if ( array( i) .ne. (i) ) then
errors = errors + 1
end if
end do
end function
program main
use omp_lib
implicit none
integer :: i,j,red
integer :: array(1024), errors = 0
array = 1
! No-loop kernel
!$omp target teams distribute parallel do
do i = 1, 1024
array(i) = i
end do
errors = errors + check_errors(array)
! SPMD kernel (num_teams clause blocks promotion to no-loop)
array = 1
!$omp target teams distribute parallel do num_teams(3)
do i = 1, 1024
array(i) = i
end do
errors = errors + check_errors(array)
! No-loop kernel
array = 1
!$omp target teams distribute parallel do num_threads(64)
do i = 1, 1024
array(i) = i
end do
errors = errors + check_errors(array)
! SPMD kernel
array = 1
!$omp target parallel do
do i = 1, 1024
array(i) = i
end do
errors = errors + check_errors(array)
! Generic kernel
array = 1
!$omp target teams distribute
do i = 1, 1024
array(i) = i
end do
errors = errors + check_errors(array)
! SPMD kernel (reduction clause blocks promotion to no-loop)
array = 1
red =0
!$omp target teams distribute parallel do reduction(+:red)
do i = 1, 1024
red = red + array(i)
end do
if (red .ne. 1024) then
errors = errors + 1
end if
print *,"number of errors: ", errors
end program main
! CHECK: PluginInterface device {{[0-9]+}} info: Launching kernel {{.*}} SPMD-No-Loop mode
! CHECK: info: #Args: 3 Teams x Thrds: 64x 16
! CHECK: PluginInterface device {{[0-9]+}} info: Launching kernel {{.*}} SPMD mode
! CHECK: info: #Args: 3 Teams x Thrds: 3x 16 {{.*}}
! CHECK: PluginInterface device {{[0-9]+}} info: Launching kernel {{.*}} SPMD-No-Loop mode
! CHECK: info: #Args: 3 Teams x Thrds: 64x 16 {{.*}}
! CHECK: PluginInterface device {{[0-9]+}} info: Launching kernel {{.*}} SPMD mode
! CHECK: info: #Args: 3 Teams x Thrds: 1x 16
! CHECK: PluginInterface device {{[0-9]+}} info: Launching kernel {{.*}} Generic mode
! CHECK: info: #Args: 3 Teams x Thrds: 16x 16 {{.*}}
! CHECK: PluginInterface device {{[0-9]+}} info: Launching kernel {{.*}} SPMD mode
! CHECK: info: #Args: 4 Teams x Thrds: 16x 16 {{.*}}
! CHECK: number of errors: 0