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
75 lines
4.2 KiB
MLIR
75 lines
4.2 KiB
MLIR
// RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(convert-linalg-to-loops,convert-scf-to-cf,convert-arith-to-llvm),finalize-memref-to-llvm,convert-func-to-llvm,convert-cf-to-llvm,reconcile-unrealized-casts)" | mlir-runner -e print_0d -entry-point-result=void -shared-libs=%mlir_runner_utils -shared-libs=%mlir_c_runner_utils | FileCheck %s --check-prefix=PRINT-0D
|
|
// RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(convert-linalg-to-loops,convert-scf-to-cf,convert-arith-to-llvm),finalize-memref-to-llvm,convert-func-to-llvm,convert-cf-to-llvm,reconcile-unrealized-casts)" | mlir-runner -e print_1d -entry-point-result=void -shared-libs=%mlir_runner_utils -shared-libs=%mlir_c_runner_utils | FileCheck %s --check-prefix=PRINT-1D
|
|
// RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(convert-linalg-to-loops,convert-scf-to-cf,convert-arith-to-llvm),finalize-memref-to-llvm,convert-func-to-llvm,convert-cf-to-llvm,reconcile-unrealized-casts)" | mlir-runner -e print_3d -entry-point-result=void -shared-libs=%mlir_runner_utils -shared-libs=%mlir_c_runner_utils | FileCheck %s --check-prefix=PRINT-3D
|
|
// RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(convert-linalg-to-loops,convert-scf-to-cf,convert-arith-to-llvm),finalize-memref-to-llvm,convert-func-to-llvm,convert-cf-to-llvm,reconcile-unrealized-casts)" | mlir-runner -e vector_splat_2d -entry-point-result=void -shared-libs=%mlir_runner_utils -shared-libs=%mlir_c_runner_utils | FileCheck %s --check-prefix=PRINT-VECTOR-SPLAT-2D
|
|
// XFAIL: system-aix
|
|
|
|
func.func @print_0d() {
|
|
%f = arith.constant 2.00000e+00 : f32
|
|
%A = memref.alloc() : memref<f32>
|
|
memref.store %f, %A[]: memref<f32>
|
|
%U = memref.cast %A : memref<f32> to memref<*xf32>
|
|
call @printMemrefF32(%U): (memref<*xf32>) -> ()
|
|
memref.dealloc %A : memref<f32>
|
|
return
|
|
}
|
|
// PRINT-0D: Unranked Memref base@ = {{.*}} rank = 0 offset = 0 sizes = [] strides = [] data =
|
|
// PRINT-0D: [2]
|
|
|
|
func.func @print_1d() {
|
|
%f = arith.constant 2.00000e+00 : f32
|
|
%A = memref.alloc() : memref<16xf32>
|
|
%B = memref.cast %A: memref<16xf32> to memref<?xf32>
|
|
linalg.fill ins(%f : f32) outs(%B : memref<?xf32>)
|
|
%U = memref.cast %B : memref<?xf32> to memref<*xf32>
|
|
call @printMemrefF32(%U): (memref<*xf32>) -> ()
|
|
memref.dealloc %A : memref<16xf32>
|
|
return
|
|
}
|
|
// PRINT-1D: Unranked Memref base@ = {{.*}} rank = 1 offset = 0 sizes = [16] strides = [1] data =
|
|
// PRINT-1D-NEXT: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
|
|
|
|
func.func @print_3d() {
|
|
%f = arith.constant 2.00000e+00 : f32
|
|
%f4 = arith.constant 4.00000e+00 : f32
|
|
%A = memref.alloc() : memref<3x4x5xf32>
|
|
%B = memref.cast %A: memref<3x4x5xf32> to memref<?x?x?xf32>
|
|
linalg.fill ins(%f : f32) outs(%B : memref<?x?x?xf32>)
|
|
|
|
%c2 = arith.constant 2 : index
|
|
memref.store %f4, %B[%c2, %c2, %c2]: memref<?x?x?xf32>
|
|
%U = memref.cast %B : memref<?x?x?xf32> to memref<*xf32>
|
|
call @printMemrefF32(%U): (memref<*xf32>) -> ()
|
|
memref.dealloc %A : memref<3x4x5xf32>
|
|
return
|
|
}
|
|
// PRINT-3D: Unranked Memref base@ = {{.*}} rank = 3 offset = 0 sizes = [3, 4, 5] strides = [20, 5, 1] data =
|
|
// PRINT-3D-COUNT-4: {{.*[[:space:]].*}}2, 2, 2, 2, 2
|
|
// PRINT-3D-COUNT-4: {{.*[[:space:]].*}}2, 2, 2, 2, 2
|
|
// PRINT-3D-COUNT-2: {{.*[[:space:]].*}}2, 2, 2, 2, 2
|
|
// PRINT-3D-NEXT: 2, 2, 4, 2, 2
|
|
// PRINT-3D-NEXT: 2, 2, 2, 2, 2
|
|
|
|
func.func private @printMemrefF32(memref<*xf32>) attributes { llvm.emit_c_interface }
|
|
|
|
!vector_type_C = vector<4x4xf32>
|
|
!matrix_type_CC = memref<1x1x!vector_type_C>
|
|
func.func @vector_splat_2d() {
|
|
%c0 = arith.constant 0 : index
|
|
%f10 = arith.constant 10.0 : f32
|
|
%vf10 = vector.broadcast %f10: f32 to !vector_type_C
|
|
%C = memref.alloc() : !matrix_type_CC
|
|
memref.store %vf10, %C[%c0, %c0]: !matrix_type_CC
|
|
|
|
%CC = memref.cast %C: !matrix_type_CC to memref<?x?x!vector_type_C>
|
|
call @printMemrefVector4x4xf32(%CC): (memref<?x?x!vector_type_C>) -> ()
|
|
|
|
memref.dealloc %C : !matrix_type_CC
|
|
return
|
|
}
|
|
|
|
// PRINT-VECTOR-SPLAT-2D: Memref base@ = {{.*}} rank = 2 offset = 0 sizes = [1, 1] strides = [1, 1] data =
|
|
// PRINT-VECTOR-SPLAT-2D-NEXT: [((10, 10, 10, 10), (10, 10, 10, 10), (10, 10, 10, 10), (10, 10, 10, 10))]
|
|
|
|
func.func private @printMemrefVector4x4xf32(memref<?x?x!vector_type_C>) attributes { llvm.emit_c_interface }
|