1 func.func @depthwise_conv_1d_nwc_wcm(%input: tensor<1x12x8xf32>, %filter: tensor<3x8x8xf32>)
4 // ^ variable.parameter
6 // ^ variable.parameter
8 -> tensor<1x10x8x8xf32> {
11 %zero = arith.constant 0.000000e+00 : f32
16 %init = tensor.empty() : tensor<1x10x8x8xf32>
20 %fill = linalg.fill ins(%zero : f32) outs(%init : tensor<1x10x8x8xf32>) -> tensor<1x10x8x8xf32>
27 %0 = linalg.depthwise_conv_1d_nwc_wcm {dilations = dense<1> : tensor<1xi64>,
32 strides = dense<1> : tensor<1xi64>}
34 ins(%input, %filter : tensor<1x12x8xf32>, tensor<3x8x8xf32>)
35 // ^ variable.parameter
36 // ^ variable.parameter
37 outs(%fill : tensor<1x10x8x8xf32>) -> tensor<1x10x8x8xf32>
39 return %0 : tensor<1x10x8x8xf32>
44 func.func @fastmath(%arg0: f32, %arg1: f32) {
45 // <- function.builtin
47 // ^ variable.parameter
49 // ^ variable.parameter
51 %5 = arith.negf %arg0 fastmath<fast> : f32
54 %6 = arith.addf %arg0, %arg1 fastmath<none> : f32
57 %8 = arith.mulf %arg0, %arg1 fastmath<reassoc,nnan,ninf,nsz,arcp,contract,afn> : f32
64 #map0 = affine_map<(d0, d1) -> (d0, d1)>
67 #map1 = affine_map<(d0, d1) -> (d0)>
70 #map2 = affine_map<(d0) -> (d0)>
74 func.func @add_broadcast_mul_fusion(%arg0: tensor<?xf32>, %arg1 : tensor<?xf32>,
75 %arg2 : tensor<?x?xf32>) -> tensor<?x?xf32>
77 %c0 = arith.constant 0 : index
78 %c1 = arith.constant 1 : index
79 %0 = tensor.dim %arg0, %c0 : tensor<?xf32>
80 %1 = tensor.empty(%0) : tensor<?xf32>
81 %2 = linalg.generic {indexing_maps = [#map2, #map2, #map2], iterator_types = ["parallel"]}
85 ins(%arg0, %arg1 : tensor<?xf32>, tensor<?xf32>)
87 outs(%1 : tensor<?xf32>) {
89 ^bb0(%arg3: f32, %arg4: f32, %arg5: f32):
90 %3 = arith.addf %arg3, %arg4 : f32
93 %3 = tensor.dim %arg2, %c1 : tensor<?x?xf32>
94 %4 = tensor.empty(%0, %3) : tensor<?x?xf32>
95 %5 = linalg.generic {indexing_maps = [#map1, #map0, #map0], iterator_types = ["parallel", "parallel"]}
97 ins(%2, %arg2 : tensor<?xf32>, tensor<?x?xf32>)
98 outs(%4 : tensor<?x?xf32>){
99 ^bb0(%arg5: f32, %arg6: f32, %arg7: f32):
100 %6 = arith.mulf %arg5, %arg6 : f32
101 linalg.yield %6 : f32
103 return %5 : tensor<?x?xf32>
106 func.func @broadcast(%input: tensor<8x32xf32>,
107 %init: tensor<8x16x32xf32>) -> tensor<8x16x32xf32> {
108 %bcast = linalg.broadcast
109 // ^ function.builtin
110 ins(%input:tensor<8x32xf32>)
112 outs(%init:tensor<8x16x32xf32>)
116 func.return %bcast : tensor<8x16x32xf32>