@@ -812,6 +812,30 @@ func.func @depthwise_conv2d_dyn_w_h(%arg0: tensor<2x?x?x3xf32>, %arg1: tensor<3x
812
812
813
813
// -----
814
814
815
+ // CHECK: #[[$MAP0:.*]] = affine_map<(d0, d1, d2, d3) -> (d3)>
816
+ // CHECK: #[[$MAP1:.*]] = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>
817
+
818
+ // CHECK-LABEL: @depthwise_int_conv_zero_zp
819
+ func.func @depthwise_int_conv_zero_zp (%arg0 : tensor <1 x7 x5 x3 xi8 >, %arg1 : tensor <3 x1 x3 x11 xi8 >, %arg2 : tensor <33 xi32 >) -> () {
820
+ // CHECK: [[INIT:%.+]] = tensor.empty()
821
+ // CHECK: [[CST0:%.+]] = arith.constant 0
822
+ // CHECK: [[FILL:%.+]] = linalg.fill ins([[CST0]]{{.*}}outs([[INIT]]
823
+ // CHECK: [[OUT:%.+]] = tensor.empty()
824
+ // CHECK: [[DEPTH:%.+]] = linalg.depthwise_conv_2d_nhwc_hwcm {dilations = dense<1> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1 : tensor<1x7x5x3xi8>, tensor<3x1x3x11xi8>) outs([[FILL]] : tensor<1x5x5x3x11xi32>)
825
+ // CHECK: [[COLLAPSED:%.+]] = tensor.collapse_shape [[DEPTH]] {{\[}}[0], [1], [2], [3, 4]]
826
+ // CHECK: [[BIAS:%.+]] = linalg.generic {indexing_maps = [#[[$MAP0]], #[[$MAP1]], #[[$MAP1]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, [[COLLAPSED]] : tensor<33xi32>, tensor<1x5x5x33xi32>) outs([[OUT]] : tensor<1x5x5x33xi32>) {
827
+ // CHECK: ^bb0(%[[ARG3:[0-9a-zA-Z_]+]]: i32, %[[ARG4:[0-9a-zA-Z_]+]]: i32, %[[ARG5:[0-9a-zA-Z_]+]]: i32):
828
+ // CHECK: [[ADD:%.+]] = arith.addi %[[ARG3]], %[[ARG4]] : i32
829
+ // CHECK: linalg.yield [[ADD]] : i32
830
+ // CHECK: } -> tensor<1x5x5x33xi32>
831
+ %input_zp = " tosa.const" () <{values = dense <0 > : tensor <1 xi8 >}> : () -> tensor <1 xi8 >
832
+ %weight_zp = " tosa.const" () <{values = dense <0 > : tensor <1 xi8 >}> : () -> tensor <1 xi8 >
833
+ %2 = tosa.depthwise_conv2d %arg0 , %arg1 , %arg2 , %input_zp , %weight_zp {acc_type = i32 , pad = array<i64 : 0 , 0 , 0 , 0 >, stride = array<i64 : 1 , 1 >, dilation = array<i64 : 1 , 1 > } : (tensor <1 x7 x5 x3 xi8 >, tensor <3 x1 x3 x11 xi8 >, tensor <33 xi32 >, tensor <1 xi8 >, tensor <1 xi8 >) -> tensor <1 x5 x5 x33 xi32 >
834
+ return
835
+ }
836
+
837
+ // -----
838
+
815
839
// CHECK: #[[$MAP1:.+]] = affine_map<(d0, d1, d2, d3, d4) -> (d4)>
816
840
// CHECK: #[[$MAP2:.+]] = affine_map<(d0, d1, d2, d3, d4) -> (d0, d1, d2, d3, d4)>
817
841
0 commit comments