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
57 lines
3.5 KiB
MLIR
57 lines
3.5 KiB
MLIR
// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s
|
|
|
|
// This test checks the offload sizes provided to the OpenMP kernel argument
|
|
// structure are correct when lowering to LLVM-IR from MLIR with 3-D bounds
|
|
// provided for a 3-D array. One with full default size, and the other with
|
|
// a user specified OpenMP array sectioning. We expect the default sized
|
|
// array bounds to lower to the full size of the array and the sectioned
|
|
// array to be the size of 3*3*1*element-byte-size (36 bytes in this case).
|
|
|
|
module attributes {omp.is_target_device = false, omp.target_triples = ["amdgcn-amd-amdhsa"]} {
|
|
llvm.func @_3d_target_array_section() {
|
|
%0 = llvm.mlir.addressof @_QFEinarray : !llvm.ptr
|
|
%1 = llvm.mlir.addressof @_QFEoutarray : !llvm.ptr
|
|
%2 = llvm.mlir.constant(1 : index) : i64
|
|
%3 = llvm.mlir.constant(0 : index) : i64
|
|
%4 = llvm.mlir.constant(2 : index) : i64
|
|
%5 = omp.map.bounds lower_bound(%3 : i64) upper_bound(%4 : i64) stride(%2 : i64) start_idx(%2 : i64)
|
|
%6 = omp.map.bounds lower_bound(%2 : i64) upper_bound(%2 : i64) stride(%2 : i64) start_idx(%2 : i64)
|
|
%7 = omp.map.info var_ptr(%0 : !llvm.ptr, !llvm.array<3 x array<3 x array<3 x i32>>>) map_clauses(tofrom) capture(ByRef) bounds(%5, %5, %6) -> !llvm.ptr {name = "inarray(1:3,1:3,2:2)"}
|
|
%8 = omp.map.info var_ptr(%1 : !llvm.ptr, !llvm.array<3 x array<3 x array<3 x i32>>>) map_clauses(tofrom) capture(ByRef) bounds(%5, %5, %5) -> !llvm.ptr {name = "outarray(1:3,1:3,1:3)"}
|
|
omp.target map_entries(%7 -> %arg0, %8 -> %arg1 : !llvm.ptr, !llvm.ptr) {
|
|
%9 = llvm.mlir.constant(0 : i64) : i64
|
|
%10 = llvm.mlir.constant(1 : i64) : i64
|
|
%11 = llvm.getelementptr %arg0[0, %10, %9, %9] : (!llvm.ptr, i64, i64, i64) -> !llvm.ptr, !llvm.array<3 x array<3 x array<3 x i32>>>
|
|
%12 = llvm.load %11 : !llvm.ptr -> i32
|
|
%13 = llvm.getelementptr %arg1[0, %10, %9, %9] : (!llvm.ptr, i64, i64, i64) -> !llvm.ptr, !llvm.array<3 x array<3 x array<3 x i32>>>
|
|
llvm.store %12, %13 : i32, !llvm.ptr
|
|
omp.terminator
|
|
}
|
|
llvm.return
|
|
}
|
|
llvm.mlir.global internal @_QFEinarray() {addr_space = 0 : i32} : !llvm.array<3 x array<3 x array<3 x i32>>> {
|
|
%0 = llvm.mlir.zero : !llvm.array<3 x array<3 x array<3 x i32>>>
|
|
llvm.return %0 : !llvm.array<3 x array<3 x array<3 x i32>>>
|
|
}
|
|
llvm.mlir.global internal @_QFEoutarray() {addr_space = 0 : i32} : !llvm.array<3 x array<3 x array<3 x i32>>> {
|
|
%0 = llvm.mlir.zero : !llvm.array<3 x array<3 x array<3 x i32>>>
|
|
llvm.return %0 : !llvm.array<3 x array<3 x array<3 x i32>>>
|
|
}
|
|
}
|
|
|
|
// CHECK: @.offload_sizes = private unnamed_addr constant [3 x i64] [i64 36, i64 108, i64 0]
|
|
// CHECK: @.offload_maptypes = private unnamed_addr constant [3 x i64] [i64 35, i64 35, i64 288]
|
|
// CHECK: @.offload_mapnames = private constant [3 x ptr] [ptr @0, ptr @1, ptr null]
|
|
|
|
// CHECK: define void @_3d_target_array_section()
|
|
|
|
// CHECK: %[[OFFLOADBASEPTRS:.*]] = getelementptr inbounds [3 x ptr], ptr %.offload_baseptrs, i32 0, i32 0
|
|
// CHECK: store ptr @_QFEinarray, ptr %[[OFFLOADBASEPTRS]], align 8
|
|
// CHECK: %[[OFFLOADPTRS:.*]] = getelementptr inbounds [3 x ptr], ptr %.offload_ptrs, i32 0, i32 0
|
|
// CHECK: store ptr getelementptr inbounds nuw (i8, ptr @_QFEinarray, i64 36), ptr %[[OFFLOADPTRS]], align 8
|
|
|
|
// CHECK: %[[OFFLOADBASEPTRS2:.*]] = getelementptr inbounds [3 x ptr], ptr %.offload_baseptrs, i32 0, i32 1
|
|
// CHECK: store ptr @_QFEoutarray, ptr %[[OFFLOADBASEPTRS2]], align 8
|
|
// CHECK: %[[OFFLOADPTRS2:.*]] = getelementptr inbounds [3 x ptr], ptr %.offload_ptrs, i32 0, i32 1
|
|
// CHECK: store ptr @_QFEoutarray, ptr %[[OFFLOADPTRS2]], align 8
|