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
74 lines
3.5 KiB
MLIR
74 lines
3.5 KiB
MLIR
// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
|
|
|
|
llvm.func @dealloc_foo_0(!llvm.ptr)
|
|
|
|
omp.private {type = private} @box.heap_privatizer0 : !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)> dealloc {
|
|
^bb0(%arg0: !llvm.ptr):
|
|
llvm.call @dealloc_foo_0(%arg0) : (!llvm.ptr) -> ()
|
|
omp.yield
|
|
}
|
|
|
|
llvm.func @alloc_foo_1(!llvm.ptr)
|
|
llvm.func @dealloc_foo_1(!llvm.ptr)
|
|
|
|
omp.private {type = private} @box.heap_privatizer1 : !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)> init {
|
|
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
|
|
llvm.call @alloc_foo_1(%arg0) : (!llvm.ptr) -> ()
|
|
omp.yield(%arg1 : !llvm.ptr)
|
|
} dealloc {
|
|
^bb0(%arg0: !llvm.ptr):
|
|
llvm.call @dealloc_foo_1(%arg0) : (!llvm.ptr) -> ()
|
|
omp.yield
|
|
}
|
|
|
|
llvm.func @target_allocatable_(%arg0: !llvm.ptr {fir.bindc_name = "lb"}, %arg1: !llvm.ptr {fir.bindc_name = "ub"}, %arg2: !llvm.ptr {fir.bindc_name = "l"}) attributes {fir.internal_name = "_QPtarget_allocatable"} {
|
|
%6 = llvm.mlir.constant(1 : i64) : i64
|
|
%7 = llvm.alloca %6 x i32 {bindc_name = "mapped_var"} : (i64) -> !llvm.ptr
|
|
%13 = llvm.alloca %6 x !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)> {bindc_name = "alloc_var0"} : (i64) -> !llvm.ptr
|
|
%14 = llvm.alloca %6 x !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)> {bindc_name = "alloc_var1"} : (i64) -> !llvm.ptr
|
|
%53 = omp.map.info var_ptr(%7 : !llvm.ptr, i32) map_clauses(implicit, exit_release_or_enter_alloc) capture(ByCopy) -> !llvm.ptr {name = "mapped_var"}
|
|
%54 = omp.map.info var_ptr(%13 : !llvm.ptr, !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)>) map_clauses(to) capture(ByRef) -> !llvm.ptr
|
|
%55 = omp.map.info var_ptr(%14 : !llvm.ptr, !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)>) map_clauses(to) capture(ByRef) -> !llvm.ptr
|
|
omp.target map_entries(%53 -> %arg3, %54 -> %arg4, %55 ->%arg5 : !llvm.ptr, !llvm.ptr, !llvm.ptr) private(@box.heap_privatizer0 %13 -> %arg6 [map_idx=1], @box.heap_privatizer1 %14 -> %arg7 [map_idx=2]: !llvm.ptr, !llvm.ptr) {
|
|
llvm.call @use_private_var0(%arg6) : (!llvm.ptr) -> ()
|
|
llvm.call @use_private_var1(%arg7) : (!llvm.ptr) -> ()
|
|
omp.terminator
|
|
}
|
|
llvm.return
|
|
}
|
|
|
|
|
|
llvm.func @use_private_var0(!llvm.ptr) -> ()
|
|
llvm.func @use_private_var1(!llvm.ptr) -> ()
|
|
|
|
// The first set of checks ensure that we are calling the offloaded function
|
|
// with the right arguments, especially the second argument which needs to
|
|
// be a memory reference to the descriptor for the privatized allocatable
|
|
// CHECK: define void @target_allocatable_
|
|
// CHECK-NOT: define internal void
|
|
// CHECK: %[[DESC_ALLOC0:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8 }, i64 1
|
|
// CHECK: %[[DESC_ALLOC1:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8 }, i64 1
|
|
// CHECK: call void @__omp_offloading_[[OFFLOADED_FUNCTION:.*]](ptr {{[^,]+}},
|
|
// CHECK-SAME: ptr %[[DESC_ALLOC0]], ptr %[[DESC_ALLOC1]], ptr null)
|
|
|
|
// CHECK: define internal void @__omp_offloading_[[OFFLOADED_FUNCTION]]
|
|
// CHECK-SAME: (ptr {{[^,]+}}, ptr %[[DESCRIPTOR_ARG0:[^,]+]],
|
|
// CHECK-SAME: ptr %[[DESCRIPTOR_ARG1:[^,]+]], ptr %{{.*}}) {
|
|
|
|
// `var0` privatrizer `alloc`
|
|
// CHECK: %[[PRIV_DESC0:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8 }
|
|
|
|
// `var1` privatrizer `alloc`
|
|
// CHECK: %[[PRIV_DESC1:.*]] = alloca { ptr, i64, i32, i8, i8, i8, i8 }
|
|
// CHECK: call void @alloc_foo_1(ptr %[[DESCRIPTOR_ARG1]])
|
|
|
|
// target op body
|
|
// CHECK: call void @use_private_var0(ptr %[[PRIV_DESC0]]
|
|
// CHECK: call void @use_private_var1(ptr %[[PRIV_DESC1]]
|
|
|
|
// `var0` privatrizer `dealloc`
|
|
// CHECK: call void @dealloc_foo_0(ptr %[[PRIV_DESC0]])
|
|
|
|
// `var1` privatrizer `dealloc`
|
|
// CHECK: call void @dealloc_foo_1(ptr %[[PRIV_DESC1]])
|