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
61 lines
2.6 KiB
MLIR
61 lines
2.6 KiB
MLIR
// RUN: mlir-opt %s -wrap-emitc-func-in-class -split-input-file | FileCheck %s
|
|
// RUN: mlir-opt %s -wrap-emitc-func-in-class=func-name=execute -split-input-file | FileCheck %s --check-prefixes=EXECUTE
|
|
|
|
emitc.func @foo(%arg0 : !emitc.array<1xf32>) {
|
|
emitc.call_opaque "bar" (%arg0) : (!emitc.array<1xf32>) -> ()
|
|
emitc.return
|
|
}
|
|
|
|
// CHECK: emitc.class @fooClass {
|
|
// CHECK: emitc.field @fieldName0 : !emitc.array<1xf32>
|
|
// CHECK: emitc.func @"operator()"() {
|
|
// CHECK: %0 = get_field @fieldName0 : !emitc.array<1xf32>
|
|
// CHECK: call_opaque "bar"(%0) : (!emitc.array<1xf32>) -> ()
|
|
// CHECK: return
|
|
// CHECK: }
|
|
// CHECK: }
|
|
|
|
// EXECUTE-NOT: operator
|
|
// EXECUTE: execute()
|
|
|
|
// -----
|
|
|
|
module attributes { } {
|
|
emitc.func @model(%arg0: !emitc.array<1xf32> {emitc.name_hint = "another_feature"},
|
|
%arg1: !emitc.array<1xf32> {emitc.name_hint = "some_feature"},
|
|
%arg2: !emitc.array<1xf32> {emitc.name_hint = "output_0"}) attributes { } {
|
|
%0 = "emitc.constant"() <{value = 0 : index}> : () -> !emitc.size_t
|
|
%1 = subscript %arg1[%0] : (!emitc.array<1xf32>, !emitc.size_t) -> !emitc.lvalue<f32>
|
|
%2 = load %1 : <f32>
|
|
%3 = subscript %arg0[%0] : (!emitc.array<1xf32>, !emitc.size_t) -> !emitc.lvalue<f32>
|
|
%4 = load %3 : <f32>
|
|
%5 = add %2, %4 : (f32, f32) -> f32
|
|
%6 = subscript %arg2[%0] : (!emitc.array<1xf32>, !emitc.size_t) -> !emitc.lvalue<f32>
|
|
assign %5 : f32 to %6 : <f32>
|
|
return
|
|
}
|
|
}
|
|
|
|
// CHECK: emitc.class @modelClass {
|
|
// CHECK: emitc.field @fieldName0 : !emitc.array<1xf32> {emitc.name_hint = "another_feature"}
|
|
// CHECK: emitc.field @fieldName1 : !emitc.array<1xf32> {emitc.name_hint = "some_feature"}
|
|
// CHECK: emitc.field @fieldName2 : !emitc.array<1xf32> {emitc.name_hint = "output_0"}
|
|
// CHECK: emitc.func @"operator()"() {
|
|
// CHECK: get_field @fieldName0 : !emitc.array<1xf32>
|
|
// CHECK: get_field @fieldName1 : !emitc.array<1xf32>
|
|
// CHECK: get_field @fieldName2 : !emitc.array<1xf32>
|
|
// CHECK: "emitc.constant"() <{value = 0 : index}> : () -> !emitc.size_t
|
|
// CHECK: subscript {{.*}}[{{.*}}] : (!emitc.array<1xf32>, !emitc.size_t) -> !emitc.lvalue<f32>
|
|
// CHECK: load {{.*}} : <f32>
|
|
// CHECK: subscript {{.*}}[{{.*}}] : (!emitc.array<1xf32>, !emitc.size_t) -> !emitc.lvalue<f32>
|
|
// CHECK: load {{.*}} : <f32>
|
|
// CHECK: add {{.*}}, {{.*}} : (f32, f32) -> f32
|
|
// CHECK: subscript {{.*}}[{{.*}}] : (!emitc.array<1xf32>, !emitc.size_t) -> !emitc.lvalue<f32>
|
|
// CHECK: assign {{.*}} : f32 to {{.*}} : <f32>
|
|
// CHECK: return
|
|
// CHECK: }
|
|
// CHECK: }
|
|
|
|
// EXECUTE-NOT: operator
|
|
// EXECUTE: execute()
|