-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: hanhanW <[email protected]>
- Loading branch information
Showing
1 changed file
with
8 additions
and
3 deletions.
There are no files selected for viewing
11 changes: 8 additions & 3 deletions
11
compiler/src/iree/compiler/Dialect/Stream/Transforms/test/specialize_encodings.mlir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
// RUN: iree-opt --split-input-file --iree-stream-specialize-encodings %s | FileCheck %s | ||
|
||
#executable_target_vmvx_bytecode_fb = #hal.executable.target<"vmvx", "vmvx-bytecode-fb", {encoding_layout = #iree_cpu.vmvx_encoding_layout<>, ukernels = "all"}> | ||
//------------------------------------------------------------------------------ | ||
// Stream ops that have TensorPhaseOp trait. This test suite tests that the | ||
// encoding is updated that carries resolved layouts. | ||
//------------------------------------------------------------------------------ | ||
|
||
#executable_target_vmvx_bytecode_fb = #hal.executable.target<"vmvx", "vmvx-bytecode-fb", {encoding_layout = #iree_cpu.vmvx_encoding_layout<>}> | ||
#device_target_local_0_ = #hal.device.target<"local", {ordinal = 0 : index}, [#executable_target_vmvx_bytecode_fb]> : !hal.device | ||
#encoding = #iree_encoding.encoding<operand_index = 0 : index, op_type = matmul, element_types = [f32, f32, f32]> | ||
module { | ||
util.global private @device_a = #device_target_local_0_ | ||
|
||
util.func public @main(%d0: index, %d1: index) -> index { | ||
util.func public @tensor_sizeof(%d0: index, %d1: index) -> index { | ||
%size = stream.tensor.sizeof on(#hal.device.affinity<@device_a>) tensor<?x?xf32, #encoding>{%d0, %d1} : index | ||
util.return %size : index | ||
} | ||
} | ||
// CHECK: #[[EXECUTABLE:.+]] = #hal.executable.target<"vmvx", | ||
// CHECK: #[[$ENCODING:.+]] = #iree_encoding.encoding | ||
// CHECK-SAME: layouts = [#[[EXECUTABLE]]] | ||
// CHECK-LABEL: util.func public @main | ||
// CHECK-LABEL: util.func public @tensor_sizeof | ||
// CHECK: %[[RES:.+]] = stream.tensor.sizeof {{.+}} tensor<?x?xf32, #[[$ENCODING]]> | ||
// CHECK: return %[[RES]] |