@@ -877,14 +877,14 @@ func.func @test_transpose_dyn(%arg0: tensor<1x?x3x4xi32>) -> () {
877
877
// CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1) -> (d1, d0)>
878
878
// CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1) -> (d0, d1)>
879
879
880
- // CHECK-LABEL: @test_transpose_dyn
880
+ // CHECK-LABEL: @test_transpose_dyn_multiple_2d
881
881
// CHECK-SAME: (%[[ARG0:.+]]: tensor<?x?xf32>)
882
- func.func @test_transpose_dyn_multiple (%arg0: tensor <?x?xf32 >) -> () {
882
+ func.func @test_transpose_dyn_multiple_2d (%arg0: tensor <?x?xf32 >) -> () {
883
883
%0 = arith.constant dense <[1 , 0 ]> : tensor <2 xi32 >
884
- // CHECK: %[[C0:.+]] = arith.constant 0
885
- // CHECK: %[[DIM0:.+]] = tensor.dim %[[ARG0]], %[[C0]]
886
- // CHECK: %[[C1:.+]] = arith.constant 1
887
- // CHECK: %[[DIM1:.+]] = tensor.dim %[[ARG0]], %[[C1]]
884
+ // CHECK-DAG : %[[C0:.+]] = arith.constant 0
885
+ // CHECK-DAG : %[[DIM0:.+]] = tensor.dim %[[ARG0]], %[[C0]]
886
+ // CHECK-DAG : %[[C1:.+]] = arith.constant 1
887
+ // CHECK-DAG : %[[DIM1:.+]] = tensor.dim %[[ARG0]], %[[C1]]
888
888
// CHECK: %[[INIT:.+]] = tensor.empty(%[[DIM1]], %[[DIM0]])
889
889
// CHECK: %[[GENERIC:.+]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["parallel", "parallel"]} ins(%[[ARG0]] : tensor<?x?xf32>) outs([[OUT:%.+]] : tensor<?x?xf32>)
890
890
// CHECK: ^bb0([[ARG1:%.+]]: f32, [[ARG2:%.+]]: f32)
@@ -896,6 +896,29 @@ func.func @test_transpose_dyn_multiple(%arg0: tensor<?x?xf32>) -> () {
896
896
897
897
// -----
898
898
899
+ // CHECK: #[[$MAP0:.+]] = affine_map<(d0, d1, d2) -> (d1, d2, d0)>
900
+ // CHECK: #[[$MAP1:.+]] = affine_map<(d0, d1, d2) -> (d0, d1, d2)>
901
+
902
+ // CHECK-LABEL: @test_transpose_dyn_multiple_3d
903
+ // CHECK-SAME: (%[[ARG0:.+]]: tensor<?x?x?xf32>)
904
+ func.func @test_transpose_dyn_multiple_3d (%arg0: tensor <?x?x?xf32 >) {
905
+ %0 = arith.constant dense <[2 , 0 , 1 ]> : tensor <3 xi32 >
906
+ // CHECK-DAG: %[[C0:.*]] = arith.constant 0 : index
907
+ // CHECK-DAG: %[[DIM0:.*]] = tensor.dim %[[ARG0]], %[[C0]] : tensor<?x?x?xf32>
908
+ // CHECK-DAG: %[[C1:.*]] = arith.constant 1 : index
909
+ // CHECK-DAG: %[[DIM1:.*]] = tensor.dim %[[ARG0]], %[[C1]] : tensor<?x?x?xf32>
910
+ // CHECK-DAG: %[[C2:.*]] = arith.constant 2 : index
911
+ // CHECK-DAG: %[[DIM2:.*]] = tensor.dim %[[ARG0]], %[[C2]] : tensor<?x?x?xf32>
912
+ // CHECK: %[[INIT:.*]] = tensor.empty(%[[DIM2]], %[[DIM0]], %[[DIM1]]) : tensor<?x?x?xf32>
913
+ // CHECK: %[[GENERIC:.*]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]]], iterator_types = ["parallel", "parallel", "parallel"]} ins(%[[ARG0]] : tensor<?x?x?xf32>) outs(%[[INIT]] : tensor<?x?x?xf32>) {
914
+ // CHECK: ^bb0(%[[IN0:.*]]: f32, %[[OUT0:.*]]: f32):
915
+ // CHECK: linalg.yield %[[IN0]] : f32
916
+ // CHECK: } -> tensor<?x?x?xf32>
917
+ %1 = " tosa.transpose" (%arg0 , %0 ) : (tensor <?x?x?xf32 >, tensor <3 xi32 >) -> tensor <?x?x?xf32 >
918
+ return
919
+ }
920
+
921
+ // -----
899
922
900
923
// CHECK-LABEL: @reduce_float
901
924
// CHECK-SAME: [[ARG0:%.+]]: tensor<5x4xf32>
0 commit comments