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
68 lines
2.4 KiB
MLIR
68 lines
2.4 KiB
MLIR
// RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(convert-scf-to-cf,convert-arith-to-llvm),finalize-memref-to-llvm,convert-func-to-llvm{use-bare-ptr-memref-call-conv=1},convert-cf-to-llvm,reconcile-unrealized-casts)" | mlir-runner -shared-libs=%mlir_c_runner_utils -entry-point-result=void | FileCheck %s
|
|
// XFAIL: system-aix
|
|
|
|
// Verify bare pointer memref calling convention. `simple_add1_add2_test`
|
|
// gets two 2xf32 memrefs, adds 1.0f to the first one and 2.0f to the second
|
|
// one. 'main' calls 'simple_add1_add2_test' with {1, 1} and {2, 2} so {2, 2}
|
|
// and {4, 4} are the expected outputs.
|
|
|
|
func.func @simple_add1_add2_test(%arg0: memref<2xf32>, %arg1: memref<2xf32>) {
|
|
%c2 = arith.constant 2 : index
|
|
%c0 = arith.constant 0 : index
|
|
%c1 = arith.constant 1 : index
|
|
%cst = arith.constant 1.000000e+00 : f32
|
|
%cst_0 = arith.constant 2.000000e+00 : f32
|
|
scf.for %arg2 = %c0 to %c2 step %c1 {
|
|
%0 = memref.load %arg0[%arg2] : memref<2xf32>
|
|
%1 = arith.addf %0, %cst : f32
|
|
memref.store %1, %arg0[%arg2] : memref<2xf32>
|
|
// CHECK: 2, 2
|
|
|
|
%2 = memref.load %arg1[%arg2] : memref<2xf32>
|
|
%3 = arith.addf %1, %cst_0 : f32
|
|
memref.store %3, %arg1[%arg2] : memref<2xf32>
|
|
// CHECK-NEXT: 4, 4
|
|
}
|
|
return
|
|
}
|
|
|
|
// External declarations.
|
|
func.func private @printF32(%arg0: f32)
|
|
func.func private @printComma()
|
|
func.func private @printNewline()
|
|
|
|
func.func @main()
|
|
{
|
|
%c2 = arith.constant 2 : index
|
|
%c0 = arith.constant 0 : index
|
|
%c1 = arith.constant 1 : index
|
|
%cst = arith.constant 1.000000e+00 : f32
|
|
%cst_0 = arith.constant 2.000000e+00 : f32
|
|
%a = memref.alloc() : memref<2xf32>
|
|
%b = memref.alloc() : memref<2xf32>
|
|
scf.for %i = %c0 to %c2 step %c1 {
|
|
memref.store %cst, %a[%i] : memref<2xf32>
|
|
memref.store %cst, %b[%i] : memref<2xf32>
|
|
}
|
|
|
|
call @simple_add1_add2_test(%a, %b) : (memref<2xf32>, memref<2xf32>) -> ()
|
|
|
|
%l0 = memref.load %a[%c0] : memref<2xf32>
|
|
call @printF32(%l0) : (f32) -> ()
|
|
call @printComma() : () -> ()
|
|
%l1 = memref.load %a[%c1] : memref<2xf32>
|
|
call @printF32(%l1) : (f32) -> ()
|
|
call @printNewline() : () -> ()
|
|
|
|
%l2 = memref.load %b[%c0] : memref<2xf32>
|
|
call @printF32(%l2) : (f32) -> ()
|
|
call @printComma() : () -> ()
|
|
%l3 = memref.load %b[%c1] : memref<2xf32>
|
|
call @printF32(%l3) : (f32) -> ()
|
|
call @printNewline() : () -> ()
|
|
|
|
memref.dealloc %a : memref<2xf32>
|
|
memref.dealloc %b : memref<2xf32>
|
|
return
|
|
}
|