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
82 lines
4.4 KiB
Fortran
82 lines
4.4 KiB
Fortran
! Tests delayed privatization for `targets ... private(..)` for adjustable arrays.
|
|
! Tests different allocation
|
|
|
|
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --enable-delayed-privatization-staging \
|
|
! RUN: -mmlir --enable-gpu-heap-alloc -o - %s 2>&1 | FileCheck %s --check-prefix=CPU
|
|
|
|
! RUN: %if amdgpu-registered-target %{ \
|
|
! RUN: %flang_fc1 -triple amdgcn-amd-amdhsa -emit-hlfir \
|
|
! RUN: -fopenmp -fopenmp-is-target-device \
|
|
! RUN: -mmlir --enable-delayed-privatization-staging \
|
|
! RUN: -mmlir --enable-gpu-heap-alloc \
|
|
! RUN: -o - %s 2>&1 | \
|
|
! RUN: FileCheck %s --check-prefix=GPU-HEAP \
|
|
! RUN: %}
|
|
|
|
! RUN: %if amdgpu-registered-target %{ \
|
|
! RUN: %flang_fc1 -triple amdgcn-amd-amdhsa -emit-hlfir \
|
|
! RUN: -fopenmp -fopenmp-is-target-device \
|
|
! RUN: -mmlir --enable-delayed-privatization-staging \
|
|
! RUN: -o - %s 2>&1 | \
|
|
! RUN: FileCheck %s --check-prefix=GPU-STACK \
|
|
! RUN: %}
|
|
|
|
subroutine target_adjustable_array(n_size)
|
|
implicit none
|
|
integer, intent(in) :: n_size
|
|
integer :: alloc_var(n_size)
|
|
|
|
!$omp target private(alloc_var)
|
|
alloc_var = 1
|
|
!$omp end target
|
|
end subroutine target_adjustable_array
|
|
|
|
! CPU-LABEL: omp.private {type = private}
|
|
! CPU-SAME: @[[VAR_PRIVATIZER_SYM:.*]] : ![[DESC_TYPE:.*]] init {
|
|
! CPU-NEXT: ^bb0(%[[PRIV_ARG:.*]]: ![[TYPE:.*]], %[[PRIV_ALLOC:.*]]: ![[TYPE]]):
|
|
! CPU-NEXT: %[[PRIV_ARG_VAL:.*]] = fir.load %[[PRIV_ARG]] : ![[TYPE]]
|
|
! CPU-NEXT: %[[C0:.*]] = arith.constant 0 : index
|
|
! CPU-NEXT: %[[BOX_DIMS:.*]]:3 = fir.box_dims %[[PRIV_ARG_VAL]], %[[C0]] : (![[DESC_TYPE]], index) -> (index, index, index)
|
|
! CPU-NEXT: %[[SHAPE:.*]] = fir.shape %[[BOX_DIMS]]#1 : (index) -> !fir.shape<1>
|
|
! CPU-NEXT: %[[PRIVATE_MEM:.*]] = fir.allocmem !fir.array<?xi32>, %[[BOX_DIMS]]#1
|
|
! CPU-NEXT: %4:2 = hlfir.declare %3(%2) {[[NAME_ATTR:.*]]} : (![[HEAP_ARRAY_TYPE:.*]], !fir.shape<1>) -> (![[DESC_TYPE]], ![[HEAP_ARRAY_TYPE]])
|
|
! CPU: omp.yield(%[[PRIV_ALLOC]] : ![[TYPE]])
|
|
! CPU-NEXT: } dealloc {
|
|
! CPU-NEXT: ^bb0(%[[PRIV_ARG:.*]]: ![[TYPE]]):
|
|
! CPU-NEXT: %[[PRIV_ARG_VAL1:.*]] = fir.load %[[PRIV_ARG]] : ![[TYPE]]
|
|
! CPU-NEXT: %[[ALLOC_ADDR:.*]] = fir.box_addr %[[PRIV_ARG_VAL1]] : (![[DESC_TYPE]]) -> ![[REF_ARRAY_TYPE:.*]]
|
|
! CPU: %[[CONV:.*]] = fir.convert %[[ALLOC_ADDR]] : (![[REF_ARRAY_TYPE]]) -> ![[HEAP_ARRAY_TYPE]]
|
|
! CPU-NEXT: fir.freemem %[[CONV]] : ![[HEAP_ARRAY_TYPE]]
|
|
! CPU: omp.yield
|
|
! CPU-NEXT: }
|
|
|
|
! GPU-HEAP-LABEL: omp.private {type = private}
|
|
! GPU-HEAP-SAME: @[[VAR_PRIVATIZER_SYM:.*]] : ![[DESC_TYPE:.*]] init {
|
|
! GPU-HEAP-NEXT: ^bb0(%[[PRIV_ARG:.*]]: ![[TYPE:.*]], %[[PRIV_ALLOC:.*]]: ![[TYPE]]):
|
|
! GPU-HEAP-NEXT: %[[PRIV_ARG_VAL:.*]] = fir.load %[[PRIV_ARG]] : ![[TYPE]]
|
|
! GPU-HEAP-NEXT: %[[C0:.*]] = arith.constant 0 : index
|
|
! GPU-HEAP-NEXT: %[[BOX_DIMS:.*]]:3 = fir.box_dims %[[PRIV_ARG_VAL]], %[[C0]] : (![[DESC_TYPE]], index) -> (index, index, index)
|
|
! GPU-HEAP-NEXT: %[[SHAPE:.*]] = fir.shape %[[BOX_DIMS]]#1 : (index) -> !fir.shape<1>
|
|
! GPU-HEAP-NEXT: %[[PRIVATE_MEM:.*]] = fir.allocmem !fir.array<?xi32>, %[[BOX_DIMS]]#1
|
|
! GPU-HEAP-NEXT: %4:2 = hlfir.declare %3(%2) {[[NAME_ATTR:.*]]} : (![[HEAP_ARRAY_TYPE:.*]], !fir.shape<1>) -> (![[DESC_TYPE]], ![[HEAP_ARRAY_TYPE]])
|
|
! GPU-HEAP: omp.yield(%[[PRIV_ALLOC]] : ![[TYPE]])
|
|
! GPU-HEAP-NEXT: } dealloc {
|
|
! GPU-HEAP-NEXT: ^bb0(%[[PRIV_ARG:.*]]: ![[TYPE]]):
|
|
! GPU-HEAP-NEXT: %[[PRIV_ARG_VAL1:.*]] = fir.load %[[PRIV_ARG]] : ![[TYPE]]
|
|
! GPU-HEAP-NEXT: %[[ALLOC_ADDR:.*]] = fir.box_addr %[[PRIV_ARG_VAL1]] : (![[DESC_TYPE]]) -> ![[REF_ARRAY_TYPE:.*]]
|
|
! GPU-HEAP: %[[CONV:.*]] = fir.convert %[[ALLOC_ADDR]] : (![[REF_ARRAY_TYPE]]) -> ![[HEAP_ARRAY_TYPE]]
|
|
! GPU-HEAP-NEXT: fir.freemem %[[CONV]] : ![[HEAP_ARRAY_TYPE]]
|
|
! GPU-HEAP: omp.yield
|
|
! GPU-HEAP-NEXT: }
|
|
|
|
! GPU-STACK-LABEL: omp.private {type = private}
|
|
! GPU-STACK-SAME: @[[VAR_PRIVATIZER_SYM:.*]] : ![[DESC_TYPE:.*]] init {
|
|
! GPU-STACK-NEXT: ^bb0(%[[PRIV_ARG:.*]]: ![[TYPE:.*]], %[[PRIV_ALLOC:.*]]: ![[TYPE]]):
|
|
! GPU-STACK-NEXT: %[[PRIV_ARG_VAL:.*]] = fir.load %[[PRIV_ARG]] : ![[TYPE]]
|
|
! GPU-STACK-NEXT: %[[C0:.*]] = arith.constant 0 : index
|
|
! GPU-STACK-NEXT: %[[BOX_DIMS:.*]]:3 = fir.box_dims %[[PRIV_ARG_VAL]], %[[C0]] : (![[DESC_TYPE]], index) -> (index, index, index)
|
|
! GPU-STACK-NOT: %[[PRIVATE_MEM:.*]] = fir.allocmem
|
|
! GPU-STACK: %[[ALLOCA_ADDR:.*]] = fir.alloca !fir.array<?xi32>, %[[BOX_DIMS]]#1 {[[NAME_ATTR:.*]]}
|
|
! GPU-STACK: omp.yield(%[[PRIV_ALLOC]] : ![[TYPE]])
|
|
|