Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bjacob/7ca58b091ee67e24df296c2b42ca6534 to your computer and use it in GitHub Desktop.
Save bjacob/7ca58b091ee67e24df296c2b42ca6534 to your computer and use it in GitHub Desktop.
#map0 = affine_map<(d0, d1, d2) -> (d0, d1)>
#map1 = affine_map<(d0, d1, d2) -> (d1, d2)>
#map2 = affine_map<(d0, d1, d2) -> (d0, d2)>
#map3 = affine_map<(d0, d1) -> (d0, d1)>
#map4 = affine_map<(d0, d1, d2, d3) -> (d0, d2, d1, d3)>
#map5 = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2, d3)>
#map6 = affine_map<(d0, d1, d2, d3) -> (d1, d3, d0, d2)>
module @matmul_f32 {
func private @reference_matmul(%arg0: tensor<?x?xf32>, %arg1: tensor<?x?xf32>, %arg2: tensor<?x?xf32>) -> tensor<?x?xf32> {
%0 = linalg.generic {indexing_maps = [#map0, #map1, #map2], iterator_types = ["parallel", "reduction", "parallel"]} ins(%arg0, %arg1 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%arg2 : tensor<?x?xf32>) {
^bb0(%arg3: f32, %arg4: f32, %arg5: f32): // no predecessors
%1 = mulf %arg3, %arg4 : f32
%2 = addf %1, %arg5 : f32
linalg.yield %2 : f32
} -> tensor<?x?xf32>
return %0 : tensor<?x?xf32>
}
func private @zero_matrix(%arg0: index, %arg1: index) -> tensor<?x?xf32> {
%cst = constant 0.000000e+00 : f32
%0 = linalg.init_tensor [%arg0, %arg1] : tensor<?x?xf32>
%1 = linalg.fill(%cst, %0) : f32, tensor<?x?xf32> -> tensor<?x?xf32>
return %1 : tensor<?x?xf32>
}
func private @zero_accumulator_matrix(%arg0: index, %arg1: index) -> tensor<?x?xf32> {
%0 = call @zero_matrix(%arg0, %arg1) : (index, index) -> tensor<?x?xf32>
return %0 : tensor<?x?xf32>
}
func private @random_matrix(%arg0: index, %arg1: index, %arg2: i32) -> tensor<?x?xf32> {
%cst = constant -1.000000e+00 : f64
%cst_0 = constant 1.000000e+00 : f64
%c2147483647_i64 = constant 2147483647 : i64
%c1103515245_i32 = constant 1103515245 : i32
%c12345_i32 = constant 12345 : i32
%cst_1 = constant 2.3283063999999999E-10 : f64
%0 = linalg.init_tensor [%arg0, %arg1] : tensor<?x?xf32>
%1 = linalg.fill_rng_2d ins(%cst, %cst_0, %arg2 : f64, f64, i32) outs(%0 : tensor<?x?xf32>) -> tensor<?x?xf32>
return %1 : tensor<?x?xf32>
}
func private @random_accumulator_matrix(%arg0: index, %arg1: index, %arg2: i32) -> tensor<?x?xf32> {
%0 = call @random_matrix(%arg0, %arg1, %arg2) : (index, index, i32) -> tensor<?x?xf32>
return %0 : tensor<?x?xf32>
}
func private @identity_matrix(%arg0: index, %arg1: index) -> tensor<?x?xf32> {
%cst = constant 0.000000e+00 : f32
%cst_0 = constant 1.000000e+00 : f32
%0 = linalg.init_tensor [%arg0, %arg1] : tensor<?x?xf32>
%1 = linalg.generic {indexing_maps = [#map3, #map3], iterator_types = ["parallel", "parallel"]} ins(%0 : tensor<?x?xf32>) outs(%0 : tensor<?x?xf32>) {
^bb0(%arg2: f32, %arg3: f32): // no predecessors
%2 = linalg.index 0 : index
%3 = linalg.index 1 : index
%4 = cmpi eq, %2, %3 : index
%5 = select %4, %cst_0, %cst : f32
linalg.yield %5 : f32
} -> tensor<?x?xf32>
return %1 : tensor<?x?xf32>
}
func private @identity_accumulator_matrix(%arg0: index, %arg1: index) -> tensor<?x?xf32> {
%0 = call @identity_matrix(%arg0, %arg1) : (index, index) -> tensor<?x?xf32>
return %0 : tensor<?x?xf32>
}
func @dynamic_shapes_identity_1x1_times_identity_1x1_plus_zero_accumulator() {
%c1 = constant 1 : index
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x1_times_identity_1x1_plus_zero_accumulator() {
%c1 = constant 1 : index
%c48271_i32 = constant 48271 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c48271_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1_times_random_1x1_plus_zero_accumulator() {
%c1 = constant 1 : index
%c182605794_i32 = constant 182605794 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c182605794_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1_times_identity_1x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c1291394886_i32 = constant 1291394886 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1291394886_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x1_times_random_1x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c1914720637_i32 = constant 1914720637 : i32
%c2078669041_i32 = constant 2078669041 : i32
%c407355683_i32 = constant 407355683 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1914720637_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2078669041_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c407355683_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1x1_times_random_1x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c1105902161_i32 = constant 1105902161 : i32
%c854716505_i32 = constant 854716505 : i32
%c564586691_i32 = constant 564586691 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1105902161_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c854716505_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c564586691_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1x1xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1x1xf32>, tensor<1x1xf32>) outs(%8 : tensor<1x1xf32>) -> tensor<1x1xf32>
%10 = tensor.cast %9 : tensor<1x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1x1_times_random_1x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c1596680831_i32 = constant 1596680831 : i32
%c192302371_i32 = constant 192302371 : i32
%c1203428207_i32 = constant 1203428207 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1596680831_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c192302371_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1203428207_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1x1xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1x1xf32>, tensor<1x1xf32>) outs(%8 : tensor<1x1xf32>) -> tensor<1x1xf32>
%10 = tensor.cast %9 : tensor<1x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_2x2_times_identity_2x2_plus_zero_accumulator() {
%c2 = constant 2 : index
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c2) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_2x2_times_identity_2x2_plus_zero_accumulator() {
%c2 = constant 2 : index
%c1559527823_i32 = constant 1559527823 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c2) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c1559527823_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_2x2_times_random_2x2_plus_zero_accumulator() {
%c2 = constant 2 : index
%c2075782095_i32 = constant 2075782095 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c2) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2075782095_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_2x2_times_identity_2x2_plus_random_accumulator() {
%c2 = constant 2 : index
%c638022372_i32 = constant 638022372 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c2) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c638022372_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_2x2_times_random_2x2_plus_random_accumulator() {
%c2 = constant 2 : index
%c914937185_i32 = constant 914937185 : i32
%c1931656580_i32 = constant 1931656580 : i32
%c1402304087_i32 = constant 1402304087 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c2) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c914937185_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1931656580_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1402304087_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_2x2_times_random_2x2_plus_random_accumulator() {
%c2 = constant 2 : index
%c1936030137_i32 = constant 1936030137 : i32
%c2064876628_i32 = constant 2064876628 : i32
%c353718330_i32 = constant 353718330 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c2) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c1936030137_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2064876628_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c353718330_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<2x2xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<2x2xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<2x2xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<2x2xf32>, tensor<2x2xf32>) outs(%8 : tensor<2x2xf32>) -> tensor<2x2xf32>
%10 = tensor.cast %9 : tensor<2x2xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_2x2_times_random_2x2_plus_random_accumulator() {
%c2 = constant 2 : index
%c1842513780_i32 = constant 1842513780 : i32
%c1947433875_i32 = constant 1947433875 : i32
%c631416347_i32 = constant 631416347 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c2) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c1842513780_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1947433875_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c631416347_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<2x?xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<?x2xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x2xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<2x?xf32>, tensor<?x2xf32>) outs(%8 : tensor<?x2xf32>) -> tensor<?x2xf32>
%10 = tensor.cast %9 : tensor<?x2xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_3x3_times_identity_3x3_plus_zero_accumulator() {
%c3 = constant 3 : index
%0 = util.do_not_optimize(%c3) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_3x3_times_identity_3x3_plus_zero_accumulator() {
%c3 = constant 3 : index
%c1479919876_i32 = constant 1479919876 : i32
%0 = util.do_not_optimize(%c3) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @random_matrix(%0, %1, %c1479919876_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_3x3_times_random_3x3_plus_zero_accumulator() {
%c3 = constant 3 : index
%c1168816941_i32 = constant 1168816941 : i32
%0 = util.do_not_optimize(%c3) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1168816941_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_3x3_times_identity_3x3_plus_random_accumulator() {
%c3 = constant 3 : index
%c1272185027_i32 = constant 1272185027 : i32
%0 = util.do_not_optimize(%c3) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1272185027_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_3x3_times_random_3x3_plus_random_accumulator() {
%c3 = constant 3 : index
%c201068705_i32 = constant 201068705 : i32
%c1308858262_i32 = constant 1308858262 : i32
%c928270262_i32 = constant 928270262 : i32
%0 = util.do_not_optimize(%c3) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @random_matrix(%0, %1, %c201068705_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1308858262_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c928270262_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_3x3_times_random_3x3_plus_random_accumulator() {
%c3 = constant 3 : index
%c1287522347_i32 = constant 1287522347 : i32
%c1814467857_i32 = constant 1814467857 : i32
%c1057382352_i32 = constant 1057382352 : i32
%0 = util.do_not_optimize(%c3) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @random_matrix(%0, %1, %c1287522347_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1814467857_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1057382352_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<3x3xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<3x3xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<3x3xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<3x3xf32>, tensor<3x3xf32>) outs(%8 : tensor<3x3xf32>) -> tensor<3x3xf32>
%10 = tensor.cast %9 : tensor<3x3xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_3x3_times_random_3x3_plus_random_accumulator() {
%c3 = constant 3 : index
%c1659675143_i32 = constant 1659675143 : i32
%c153892771_i32 = constant 153892771 : i32
%c412013968_i32 = constant 412013968 : i32
%0 = util.do_not_optimize(%c3) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @random_matrix(%0, %1, %c1659675143_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c153892771_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c412013968_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<?x3xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<3x3xf32>
%8 = linalg.matmul ins(%6, %4 : tensor<?x3xf32>, tensor<?x?xf32>) outs(%7 : tensor<3x3xf32>) -> tensor<3x3xf32>
%9 = tensor.cast %8 : tensor<3x3xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_4x4_times_identity_4x4_plus_zero_accumulator() {
%c4 = constant 4 : index
%0 = util.do_not_optimize(%c4) : index
%1 = util.do_not_optimize(%c4) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_4x4_times_identity_4x4_plus_zero_accumulator() {
%c4 = constant 4 : index
%c1587659744_i32 = constant 1587659744 : i32
%0 = util.do_not_optimize(%c4) : index
%1 = util.do_not_optimize(%c4) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c1587659744_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_4x4_times_random_4x4_plus_zero_accumulator() {
%c4 = constant 4 : index
%c674592135_i32 = constant 674592135 : i32
%0 = util.do_not_optimize(%c4) : index
%1 = util.do_not_optimize(%c4) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c674592135_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_4x4_times_identity_4x4_plus_random_accumulator() {
%c4 = constant 4 : index
%c942409124_i32 = constant 942409124 : i32
%0 = util.do_not_optimize(%c4) : index
%1 = util.do_not_optimize(%c4) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c942409124_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_4x4_times_random_4x4_plus_random_accumulator() {
%c4 = constant 4 : index
%c884730203_i32 = constant 884730203 : i32
%c1951824771_i32 = constant 1951824771 : i32
%c2130959757_i32 = constant 2130959757 : i32
%0 = util.do_not_optimize(%c4) : index
%1 = util.do_not_optimize(%c4) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c884730203_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1951824771_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2130959757_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_4x4_times_random_4x4_plus_random_accumulator() {
%c4 = constant 4 : index
%c1239222494_i32 = constant 1239222494 : i32
%c352020689_i32 = constant 352020689 : i32
%c1500063655_i32 = constant 1500063655 : i32
%0 = util.do_not_optimize(%c4) : index
%1 = util.do_not_optimize(%c4) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c1239222494_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c352020689_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1500063655_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<4x4xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<4x4xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<4x4xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<4x4xf32>, tensor<4x4xf32>) outs(%8 : tensor<4x4xf32>) -> tensor<4x4xf32>
%10 = tensor.cast %9 : tensor<4x4xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_4x4_times_random_4x4_plus_random_accumulator() {
%c4 = constant 4 : index
%c719080959_i32 = constant 719080959 : i32
%c978785428_i32 = constant 978785428 : i32
%c163677341_i32 = constant 163677341 : i32
%0 = util.do_not_optimize(%c4) : index
%1 = util.do_not_optimize(%c4) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c719080959_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c978785428_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c163677341_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %5 : tensor<?x?xf32> to tensor<4x?xf32>
%7 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%6 : tensor<4x?xf32>) -> tensor<4x?xf32>
%8 = tensor.cast %7 : tensor<4x?xf32> to tensor<?x?xf32>
%9 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%8, %9) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_5x5_times_identity_5x5_plus_zero_accumulator() {
%c5 = constant 5 : index
%0 = util.do_not_optimize(%c5) : index
%1 = util.do_not_optimize(%c5) : index
%2 = util.do_not_optimize(%c5) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_5x5_times_identity_5x5_plus_zero_accumulator() {
%c5 = constant 5 : index
%c1243427070_i32 = constant 1243427070 : i32
%0 = util.do_not_optimize(%c5) : index
%1 = util.do_not_optimize(%c5) : index
%2 = util.do_not_optimize(%c5) : index
%3 = call @random_matrix(%0, %1, %c1243427070_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_5x5_times_random_5x5_plus_zero_accumulator() {
%c5 = constant 5 : index
%c1447645967_i32 = constant 1447645967 : i32
%0 = util.do_not_optimize(%c5) : index
%1 = util.do_not_optimize(%c5) : index
%2 = util.do_not_optimize(%c5) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1447645967_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_5x5_times_identity_5x5_plus_random_accumulator() {
%c5 = constant 5 : index
%c200599677_i32 = constant 200599677 : i32
%0 = util.do_not_optimize(%c5) : index
%1 = util.do_not_optimize(%c5) : index
%2 = util.do_not_optimize(%c5) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c200599677_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_5x5_times_random_5x5_plus_random_accumulator() {
%c5 = constant 5 : index
%c143244144_i32 = constant 143244144 : i32
%c1788215331_i32 = constant 1788215331 : i32
%c837051536_i32 = constant 837051536 : i32
%0 = util.do_not_optimize(%c5) : index
%1 = util.do_not_optimize(%c5) : index
%2 = util.do_not_optimize(%c5) : index
%3 = call @random_matrix(%0, %1, %c143244144_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1788215331_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c837051536_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_5x5_times_random_5x5_plus_random_accumulator() {
%c5 = constant 5 : index
%c409875951_i32 = constant 409875951 : i32
%c355190910_i32 = constant 355190910 : i32
%c2058462609_i32 = constant 2058462609 : i32
%0 = util.do_not_optimize(%c5) : index
%1 = util.do_not_optimize(%c5) : index
%2 = util.do_not_optimize(%c5) : index
%3 = call @random_matrix(%0, %1, %c409875951_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c355190910_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2058462609_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<5x5xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<5x5xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<5x5xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<5x5xf32>, tensor<5x5xf32>) outs(%8 : tensor<5x5xf32>) -> tensor<5x5xf32>
%10 = tensor.cast %9 : tensor<5x5xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_5x5_times_random_5x5_plus_random_accumulator() {
%c5 = constant 5 : index
%c2127735996_i32 = constant 2127735996 : i32
%c243877847_i32 = constant 243877847 : i32
%c1869683330_i32 = constant 1869683330 : i32
%0 = util.do_not_optimize(%c5) : index
%1 = util.do_not_optimize(%c5) : index
%2 = util.do_not_optimize(%c5) : index
%3 = call @random_matrix(%0, %1, %c2127735996_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c243877847_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1869683330_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<5x5xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<5x5xf32>
%8 = linalg.matmul ins(%6, %7 : tensor<5x5xf32>, tensor<5x5xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%9 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%8, %9) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_8x8_times_identity_8x8_plus_zero_accumulator() {
%c8 = constant 8 : index
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c8) : index
%2 = util.do_not_optimize(%c8) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_8x8_times_identity_8x8_plus_zero_accumulator() {
%c8 = constant 8 : index
%c1715708819_i32 = constant 1715708819 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c8) : index
%2 = util.do_not_optimize(%c8) : index
%3 = call @random_matrix(%0, %1, %c1715708819_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_8x8_times_random_8x8_plus_zero_accumulator() {
%c8 = constant 8 : index
%c1273555394_i32 = constant 1273555394 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c8) : index
%2 = util.do_not_optimize(%c8) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1273555394_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_8x8_times_identity_8x8_plus_random_accumulator() {
%c8 = constant 8 : index
%c1925544752_i32 = constant 1925544752 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c8) : index
%2 = util.do_not_optimize(%c8) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1925544752_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_8x8_times_random_8x8_plus_random_accumulator() {
%c8 = constant 8 : index
%c583514338_i32 = constant 583514338 : i32
%c425095546_i32 = constant 425095546 : i32
%c580853881_i32 = constant 580853881 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c8) : index
%2 = util.do_not_optimize(%c8) : index
%3 = call @random_matrix(%0, %1, %c583514338_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c425095546_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c580853881_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_8x8_times_random_8x8_plus_random_accumulator() {
%c8 = constant 8 : index
%c851194519_i32 = constant 851194519 : i32
%c206008598_i32 = constant 206008598 : i32
%c1391748448_i32 = constant 1391748448 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c8) : index
%2 = util.do_not_optimize(%c8) : index
%3 = call @random_matrix(%0, %1, %c851194519_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c206008598_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1391748448_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<8x8xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<8x8xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<8x8xf32>
%9 = linalg.tensor_expand_shape %6 [[0, 1], [2, 3]] : tensor<8x8xf32> into tensor<1x8x8x1xf32>
%10 = linalg.tensor_expand_shape %7 [[0, 1], [2, 3]] : tensor<8x8xf32> into tensor<8x1x1x8xf32>
%11 = linalg.tensor_expand_shape %8 [[0, 1], [2, 3]] : tensor<8x8xf32> into tensor<1x8x1x8xf32>
%12 = linalg.init_tensor [1, 8, 8, 1] : tensor<1x8x8x1xf32>
%13 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%9 : tensor<1x8x8x1xf32>) outs(%12 : tensor<1x8x8x1xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<1x8x8x1xf32>
%14 = linalg.init_tensor [1, 8, 8, 1] : tensor<1x8x8x1xf32>
%15 = linalg.generic {indexing_maps = [#map6, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%10 : tensor<8x1x1x8xf32>) outs(%14 : tensor<1x8x8x1xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<1x8x8x1xf32>
%16 = linalg.init_tensor [1, 1, 8, 8] : tensor<1x1x8x8xf32>
%17 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%11 : tensor<1x8x1x8xf32>) outs(%16 : tensor<1x1x8x8xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<1x1x8x8xf32>
%18 = linalg.mmt4d ins(%13, %15 : tensor<1x8x8x1xf32>, tensor<1x8x8x1xf32>) outs(%17 : tensor<1x1x8x8xf32>) -> tensor<1x1x8x8xf32>
%19 = linalg.init_tensor [1, 8, 1, 8] : tensor<1x8x1x8xf32>
%20 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%18 : tensor<1x1x8x8xf32>) outs(%19 : tensor<1x8x1x8xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<1x8x1x8xf32>
%21 = linalg.tensor_collapse_shape %20 [[0, 1], [2, 3]] : tensor<1x8x1x8xf32> into tensor<8x8xf32>
%22 = tensor.cast %21 : tensor<8x8xf32> to tensor<?x?xf32>
%23 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%22, %23) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_8x8_times_random_8x8_plus_random_accumulator() {
%c8 = constant 8 : index
%c1358404307_i32 = constant 1358404307 : i32
%c268625699_i32 = constant 268625699 : i32
%c324855843_i32 = constant 324855843 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c8) : index
%2 = util.do_not_optimize(%c8) : index
%3 = call @random_matrix(%0, %1, %c1358404307_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c268625699_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c324855843_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<?x8xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<8x?xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<8x8xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<?x8xf32>, tensor<8x?xf32>) outs(%8 : tensor<8x8xf32>) -> tensor<8x8xf32>
%10 = tensor.cast %9 : tensor<8x8xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_9x9_times_identity_9x9_plus_zero_accumulator() {
%c9 = constant 9 : index
%0 = util.do_not_optimize(%c9) : index
%1 = util.do_not_optimize(%c9) : index
%2 = util.do_not_optimize(%c9) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_9x9_times_identity_9x9_plus_zero_accumulator() {
%c9 = constant 9 : index
%c1040552188_i32 = constant 1040552188 : i32
%0 = util.do_not_optimize(%c9) : index
%1 = util.do_not_optimize(%c9) : index
%2 = util.do_not_optimize(%c9) : index
%3 = call @random_matrix(%0, %1, %c1040552188_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_9x9_times_random_9x9_plus_zero_accumulator() {
%c9 = constant 9 : index
%c999647265_i32 = constant 999647265 : i32
%0 = util.do_not_optimize(%c9) : index
%1 = util.do_not_optimize(%c9) : index
%2 = util.do_not_optimize(%c9) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c999647265_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_9x9_times_identity_9x9_plus_random_accumulator() {
%c9 = constant 9 : index
%c15580725_i32 = constant 15580725 : i32
%0 = util.do_not_optimize(%c9) : index
%1 = util.do_not_optimize(%c9) : index
%2 = util.do_not_optimize(%c9) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c15580725_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_9x9_times_random_9x9_plus_random_accumulator() {
%c9 = constant 9 : index
%c477900025_i32 = constant 477900025 : i32
%c442770701_i32 = constant 442770701 : i32
%c1227253027_i32 = constant 1227253027 : i32
%0 = util.do_not_optimize(%c9) : index
%1 = util.do_not_optimize(%c9) : index
%2 = util.do_not_optimize(%c9) : index
%3 = call @random_matrix(%0, %1, %c477900025_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c442770701_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1227253027_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_9x9_times_random_9x9_plus_random_accumulator() {
%c9 = constant 9 : index
%c246980175_i32 = constant 246980175 : i32
%c1298302928_i32 = constant 1298302928 : i32
%c365367087_i32 = constant 365367087 : i32
%0 = util.do_not_optimize(%c9) : index
%1 = util.do_not_optimize(%c9) : index
%2 = util.do_not_optimize(%c9) : index
%3 = call @random_matrix(%0, %1, %c246980175_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1298302928_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c365367087_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<9x9xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<9x9xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<9x9xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<9x9xf32>, tensor<9x9xf32>) outs(%8 : tensor<9x9xf32>) -> tensor<9x9xf32>
%10 = tensor.cast %9 : tensor<9x9xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_9x9_times_random_9x9_plus_random_accumulator() {
%c9 = constant 9 : index
%c1498947413_i32 = constant 1498947413 : i32
%c524054552_i32 = constant 524054552 : i32
%c1427401579_i32 = constant 1427401579 : i32
%0 = util.do_not_optimize(%c9) : index
%1 = util.do_not_optimize(%c9) : index
%2 = util.do_not_optimize(%c9) : index
%3 = call @random_matrix(%0, %1, %c1498947413_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c524054552_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1427401579_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %4 : tensor<?x?xf32> to tensor<?x9xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x9xf32>
%8 = linalg.matmul ins(%3, %6 : tensor<?x?xf32>, tensor<?x9xf32>) outs(%7 : tensor<?x9xf32>) -> tensor<?x9xf32>
%9 = tensor.cast %8 : tensor<?x9xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_2x3_times_identity_3x4_plus_zero_accumulator() {
%c2 = constant 2 : index
%c3 = constant 3 : index
%c4 = constant 4 : index
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_2x3_times_identity_3x4_plus_zero_accumulator() {
%c2 = constant 2 : index
%c3 = constant 3 : index
%c4 = constant 4 : index
%c1210064531_i32 = constant 1210064531 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c1210064531_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_2x3_times_random_3x4_plus_zero_accumulator() {
%c2 = constant 2 : index
%c3 = constant 3 : index
%c4 = constant 4 : index
%c1617261148_i32 = constant 1617261148 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1617261148_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_2x3_times_identity_3x4_plus_random_accumulator() {
%c2 = constant 2 : index
%c3 = constant 3 : index
%c4 = constant 4 : index
%c1487339364_i32 = constant 1487339364 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1487339364_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_2x3_times_random_3x4_plus_random_accumulator() {
%c2 = constant 2 : index
%c3 = constant 3 : index
%c4 = constant 4 : index
%c685153140_i32 = constant 685153140 : i32
%c1779057140_i32 = constant 1779057140 : i32
%c1143645057_i32 = constant 1143645057 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c685153140_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1779057140_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1143645057_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_2x3_times_random_3x4_plus_random_accumulator() {
%c2 = constant 2 : index
%c3 = constant 3 : index
%c4 = constant 4 : index
%c1675916665_i32 = constant 1675916665 : i32
%c316870078_i32 = constant 316870078 : i32
%c1257001204_i32 = constant 1257001204 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c1675916665_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c316870078_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1257001204_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<2x3xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<3x4xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<2x4xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<2x3xf32>, tensor<3x4xf32>) outs(%8 : tensor<2x4xf32>) -> tensor<2x4xf32>
%10 = tensor.cast %9 : tensor<2x4xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_2x3_times_random_3x4_plus_random_accumulator() {
%c2 = constant 2 : index
%c3 = constant 3 : index
%c4 = constant 4 : index
%c1702155946_i32 = constant 1702155946 : i32
%c2045335146_i32 = constant 2045335146 : i32
%c1959645388_i32 = constant 1959645388 : i32
%0 = util.do_not_optimize(%c2) : index
%1 = util.do_not_optimize(%c3) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c1702155946_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2045335146_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1959645388_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<2x3xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<3x?xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x4xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<2x3xf32>, tensor<3x?xf32>) outs(%8 : tensor<?x4xf32>) -> tensor<?x4xf32>
%10 = tensor.cast %9 : tensor<?x4xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_8x7_times_identity_7x6_plus_zero_accumulator() {
%c8 = constant 8 : index
%c7 = constant 7 : index
%c6 = constant 6 : index
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c7) : index
%2 = util.do_not_optimize(%c6) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_8x7_times_identity_7x6_plus_zero_accumulator() {
%c8 = constant 8 : index
%c7 = constant 7 : index
%c6 = constant 6 : index
%c1634860762_i32 = constant 1634860762 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c7) : index
%2 = util.do_not_optimize(%c6) : index
%3 = call @random_matrix(%0, %1, %c1634860762_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_8x7_times_random_7x6_plus_zero_accumulator() {
%c8 = constant 8 : index
%c7 = constant 7 : index
%c6 = constant 6 : index
%c634782546_i32 = constant 634782546 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c7) : index
%2 = util.do_not_optimize(%c6) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c634782546_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_8x7_times_identity_7x6_plus_random_accumulator() {
%c8 = constant 8 : index
%c7 = constant 7 : index
%c6 = constant 6 : index
%c1291602570_i32 = constant 1291602570 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c7) : index
%2 = util.do_not_optimize(%c6) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1291602570_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_8x7_times_random_7x6_plus_random_accumulator() {
%c8 = constant 8 : index
%c7 = constant 7 : index
%c6 = constant 6 : index
%c1202416766_i32 = constant 1202416766 : i32
%c1819184117_i32 = constant 1819184117 : i32
%c1082702230_i32 = constant 1082702230 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c7) : index
%2 = util.do_not_optimize(%c6) : index
%3 = call @random_matrix(%0, %1, %c1202416766_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1819184117_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1082702230_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_8x7_times_random_7x6_plus_random_accumulator() {
%c8 = constant 8 : index
%c7 = constant 7 : index
%c6 = constant 6 : index
%c1957310938_i32 = constant 1957310938 : i32
%c665754786_i32 = constant 665754786 : i32
%c1703981298_i32 = constant 1703981298 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c7) : index
%2 = util.do_not_optimize(%c6) : index
%3 = call @random_matrix(%0, %1, %c1957310938_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c665754786_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1703981298_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<8x7xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<7x6xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<8x6xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<8x7xf32>, tensor<7x6xf32>) outs(%8 : tensor<8x6xf32>) -> tensor<8x6xf32>
%10 = tensor.cast %9 : tensor<8x6xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_8x7_times_random_7x6_plus_random_accumulator() {
%c8 = constant 8 : index
%c7 = constant 7 : index
%c6 = constant 6 : index
%c2110072011_i32 = constant 2110072011 : i32
%c136665771_i32 = constant 136665771 : i32
%c2071152004_i32 = constant 2071152004 : i32
%0 = util.do_not_optimize(%c8) : index
%1 = util.do_not_optimize(%c7) : index
%2 = util.do_not_optimize(%c6) : index
%3 = call @random_matrix(%0, %1, %c2110072011_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c136665771_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2071152004_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %4 : tensor<?x?xf32> to tensor<7x?xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<8x?xf32>
%8 = linalg.matmul ins(%3, %6 : tensor<?x?xf32>, tensor<7x?xf32>) outs(%7 : tensor<8x?xf32>) -> tensor<8x?xf32>
%9 = tensor.cast %8 : tensor<8x?xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_15x16_times_identity_16x17_plus_zero_accumulator() {
%c15 = constant 15 : index
%c16 = constant 16 : index
%c17 = constant 17 : index
%0 = util.do_not_optimize(%c15) : index
%1 = util.do_not_optimize(%c16) : index
%2 = util.do_not_optimize(%c17) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_15x16_times_identity_16x17_plus_zero_accumulator() {
%c15 = constant 15 : index
%c16 = constant 16 : index
%c17 = constant 17 : index
%c506843774_i32 = constant 506843774 : i32
%0 = util.do_not_optimize(%c15) : index
%1 = util.do_not_optimize(%c16) : index
%2 = util.do_not_optimize(%c17) : index
%3 = call @random_matrix(%0, %1, %c506843774_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_15x16_times_random_16x17_plus_zero_accumulator() {
%c15 = constant 15 : index
%c16 = constant 16 : index
%c17 = constant 17 : index
%c1722108130_i32 = constant 1722108130 : i32
%0 = util.do_not_optimize(%c15) : index
%1 = util.do_not_optimize(%c16) : index
%2 = util.do_not_optimize(%c17) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1722108130_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_15x16_times_identity_16x17_plus_random_accumulator() {
%c15 = constant 15 : index
%c16 = constant 16 : index
%c17 = constant 17 : index
%c937051507_i32 = constant 937051507 : i32
%0 = util.do_not_optimize(%c15) : index
%1 = util.do_not_optimize(%c16) : index
%2 = util.do_not_optimize(%c17) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c937051507_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_15x16_times_random_16x17_plus_random_accumulator() {
%c15 = constant 15 : index
%c16 = constant 16 : index
%c17 = constant 17 : index
%c2112721283_i32 = constant 2112721283 : i32
%c1318139310_i32 = constant 1318139310 : i32
%c109656047_i32 = constant 109656047 : i32
%0 = util.do_not_optimize(%c15) : index
%1 = util.do_not_optimize(%c16) : index
%2 = util.do_not_optimize(%c17) : index
%3 = call @random_matrix(%0, %1, %c2112721283_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1318139310_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c109656047_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_15x16_times_random_16x17_plus_random_accumulator() {
%c15 = constant 15 : index
%c16 = constant 16 : index
%c17 = constant 17 : index
%c1807338529_i32 = constant 1807338529 : i32
%c514973984_i32 = constant 514973984 : i32
%c1185967639_i32 = constant 1185967639 : i32
%0 = util.do_not_optimize(%c15) : index
%1 = util.do_not_optimize(%c16) : index
%2 = util.do_not_optimize(%c17) : index
%3 = call @random_matrix(%0, %1, %c1807338529_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c514973984_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1185967639_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<15x16xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<16x17xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<15x17xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<15x16xf32>, tensor<16x17xf32>) outs(%8 : tensor<15x17xf32>) -> tensor<15x17xf32>
%10 = tensor.cast %9 : tensor<15x17xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_15x16_times_random_16x17_plus_random_accumulator() {
%c15 = constant 15 : index
%c16 = constant 16 : index
%c17 = constant 17 : index
%c224840443_i32 = constant 224840443 : i32
%c2038155762_i32 = constant 2038155762 : i32
%c1148467491_i32 = constant 1148467491 : i32
%0 = util.do_not_optimize(%c15) : index
%1 = util.do_not_optimize(%c16) : index
%2 = util.do_not_optimize(%c17) : index
%3 = call @random_matrix(%0, %1, %c224840443_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2038155762_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1148467491_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<?x16xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<16x?xf32>
%8 = linalg.matmul ins(%6, %7 : tensor<?x16xf32>, tensor<16x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%9 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%8, %9) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10x1_times_identity_1x1_plus_zero_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_10x1_times_identity_1x1_plus_zero_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c1518866227_i32 = constant 1518866227 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1518866227_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10x1_times_random_1x1_plus_zero_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c2099934937_i32 = constant 2099934937 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2099934937_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10x1_times_identity_1x1_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c436238233_i32 = constant 436238233 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c436238233_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_10x1_times_random_1x1_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c1578586308_i32 = constant 1578586308 : i32
%c777426967_i32 = constant 777426967 : i32
%c2047876379_i32 = constant 2047876379 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1578586308_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c777426967_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2047876379_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_10x1_times_random_1x1_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c73452005_i32 = constant 73452005 : i32
%c106232158_i32 = constant 106232158 : i32
%c1889033429_i32 = constant 1889033429 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c73452005_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c106232158_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1889033429_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<10x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1x1xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<10x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<10x1xf32>, tensor<1x1xf32>) outs(%8 : tensor<10x1xf32>) -> tensor<10x1xf32>
%10 = tensor.cast %9 : tensor<10x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_10x1_times_random_1x1_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c1229515992_i32 = constant 1229515992 : i32
%c2108381340_i32 = constant 2108381340 : i32
%c130664516_i32 = constant 130664516 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1229515992_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2108381340_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c130664516_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<?x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<?x1xf32>
%8 = linalg.matmul ins(%6, %7 : tensor<?x1xf32>, tensor<?x1xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%9 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%8, %9) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x10_times_identity_10x1_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x10_times_identity_10x1_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c1753515374_i32 = constant 1753515374 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1753515374_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x10_times_random_10x1_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c872671849_i32 = constant 872671849 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c872671849_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x10_times_identity_10x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c1851087174_i32 = constant 1851087174 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1851087174_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x10_times_random_10x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c1329391778_i32 = constant 1329391778 : i32
%c2111659831_i32 = constant 2111659831 : i32
%c1620397346_i32 = constant 1620397346 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1329391778_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2111659831_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1620397346_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1x10_times_random_10x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c403414085_i32 = constant 403414085 : i32
%c1967069686_i32 = constant 1967069686 : i32
%c1431360801_i32 = constant 1431360801 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c403414085_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1967069686_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1431360801_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x10xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<10x1xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1x10xf32>, tensor<10x1xf32>) outs(%8 : tensor<1x1xf32>) -> tensor<1x1xf32>
%10 = tensor.cast %9 : tensor<1x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1x10_times_random_10x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c78366493_i32 = constant 78366493 : i32
%c1110281236_i32 = constant 1110281236 : i32
%c1783648424_i32 = constant 1783648424 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c78366493_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1110281236_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1783648424_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x10xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<10x?xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1x10xf32>, tensor<10x?xf32>) outs(%8 : tensor<?x1xf32>) -> tensor<?x1xf32>
%10 = tensor.cast %9 : tensor<?x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1_times_identity_1x10_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x1_times_identity_1x10_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c374559665_i32 = constant 374559665 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c374559665_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1_times_random_1x10_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c704765122_i32 = constant 704765122 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c704765122_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1_times_identity_1x10_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c1428751935_i32 = constant 1428751935 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1428751935_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x1_times_random_1x10_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c847330980_i32 = constant 847330980 : i32
%c540194818_i32 = constant 540194818 : i32
%c997617804_i32 = constant 997617804 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c847330980_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c540194818_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c997617804_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1x1_times_random_1x10_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c835716556_i32 = constant 835716556 : i32
%c393565781_i32 = constant 393565781 : i32
%c1173473289_i32 = constant 1173473289 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c835716556_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c393565781_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1173473289_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1x10xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1x10xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1x1xf32>, tensor<1x10xf32>) outs(%8 : tensor<1x10xf32>) -> tensor<1x10xf32>
%10 = tensor.cast %9 : tensor<1x10xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1x1_times_random_1x10_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c552976400_i32 = constant 552976400 : i32
%c1649555837_i32 = constant 1649555837 : i32
%c1311144361_i32 = constant 1311144361 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c552976400_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1649555837_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1311144361_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x?xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x10xf32>
%8 = linalg.matmul ins(%6, %4 : tensor<1x?xf32>, tensor<?x?xf32>) outs(%7 : tensor<?x10xf32>) -> tensor<?x10xf32>
%9 = tensor.cast %8 : tensor<?x10xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x10_times_identity_10x10_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x10_times_identity_10x10_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c1951015512_i32 = constant 1951015512 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c1951015512_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x10_times_random_10x10_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c1721924214_i32 = constant 1721924214 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1721924214_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x10_times_identity_10x10_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c649176859_i32 = constant 649176859 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c649176859_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x10_times_random_10x10_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c334783765_i32 = constant 334783765 : i32
%c532676640_i32 = constant 532676640 : i32
%c1012383909_i32 = constant 1012383909 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c334783765_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c532676640_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1012383909_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1x10_times_random_10x10_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c645800207_i32 = constant 645800207 : i32
%c549172245_i32 = constant 549172245 : i32
%c555299827_i32 = constant 555299827 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c645800207_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c549172245_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c555299827_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x10xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<10x10xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1x10xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1x10xf32>, tensor<10x10xf32>) outs(%8 : tensor<1x10xf32>) -> tensor<1x10xf32>
%10 = tensor.cast %9 : tensor<1x10xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1x10_times_random_10x10_plus_random_accumulator() {
%c1 = constant 1 : index
%c10 = constant 10 : index
%c2134550910_i32 = constant 2134550910 : i32
%c641593550_i32 = constant 641593550 : i32
%c1500578663_i32 = constant 1500578663 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c2134550910_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c641593550_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1500578663_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x10xf32>
%7 = linalg.matmul ins(%6, %4 : tensor<1x10xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%8 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%7, %8) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10x1_times_identity_1x10_plus_zero_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_10x1_times_identity_1x10_plus_zero_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c1517310492_i32 = constant 1517310492 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c1517310492_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10x1_times_random_1x10_plus_zero_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c17494750_i32 = constant 17494750 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c17494750_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10x1_times_identity_1x10_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c528003979_i32 = constant 528003979 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c528003979_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_10x1_times_random_1x10_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c944147713_i32 = constant 944147713 : i32
%c1056297589_i32 = constant 1056297589 : i32
%c836687898_i32 = constant 836687898 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c944147713_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1056297589_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c836687898_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_10x1_times_random_1x10_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c36575229_i32 = constant 36575229 : i32
%c291321225_i32 = constant 291321225 : i32
%c643931419_i32 = constant 643931419 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c36575229_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c291321225_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c643931419_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<10x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1x10xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<10x10xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<10x1xf32>, tensor<1x10xf32>) outs(%8 : tensor<10x10xf32>) -> tensor<10x10xf32>
%10 = tensor.cast %9 : tensor<10x10xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_10x1_times_random_1x10_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c535219871_i32 = constant 535219871 : i32
%c1370119631_i32 = constant 1370119631 : i32
%c990831342_i32 = constant 990831342 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10) : index
%3 = call @random_matrix(%0, %1, %c535219871_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1370119631_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c990831342_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<10x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1x?xf32>
%8 = linalg.matmul ins(%6, %7 : tensor<10x1xf32>, tensor<1x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%9 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%8, %9) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10x10_times_identity_10x1_plus_zero_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_10x10_times_identity_10x1_plus_zero_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c2056033720_i32 = constant 2056033720 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c2056033720_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10x10_times_random_10x1_plus_zero_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c846952015_i32 = constant 846952015 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c846952015_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10x10_times_identity_10x1_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c1574528126_i32 = constant 1574528126 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1574528126_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_10x10_times_random_10x1_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c305935522_i32 = constant 305935522 : i32
%c1716025690_i32 = constant 1716025690 : i32
%c1536849906_i32 = constant 1536849906 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c305935522_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1716025690_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1536849906_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_10x10_times_random_10x1_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c459226911_i32 = constant 459226911 : i32
%c1016016547_i32 = constant 1016016547 : i32
%c2050693698_i32 = constant 2050693698 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c459226911_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1016016547_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2050693698_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<10x10xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<10x1xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<10x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<10x10xf32>, tensor<10x1xf32>) outs(%8 : tensor<10x1xf32>) -> tensor<10x1xf32>
%10 = tensor.cast %9 : tensor<10x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_10x10_times_random_10x1_plus_random_accumulator() {
%c10 = constant 10 : index
%c1 = constant 1 : index
%c776787693_i32 = constant 776787693 : i32
%c1254252183_i32 = constant 1254252183 : i32
%c665722_i32 = constant 665722 : i32
%0 = util.do_not_optimize(%c10) : index
%1 = util.do_not_optimize(%c10) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c776787693_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1254252183_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c665722_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<10x10xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<10x?xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<10x10xf32>, tensor<10x?xf32>) outs(%8 : tensor<?x1xf32>) -> tensor<?x1xf32>
%10 = tensor.cast %9 : tensor<?x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_13x14_times_identity_14x2_plus_zero_accumulator() {
%c13 = constant 13 : index
%c14 = constant 14 : index
%c2 = constant 2 : index
%0 = util.do_not_optimize(%c13) : index
%1 = util.do_not_optimize(%c14) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_13x14_times_identity_14x2_plus_zero_accumulator() {
%c13 = constant 13 : index
%c14 = constant 14 : index
%c2 = constant 2 : index
%c1579724232_i32 = constant 1579724232 : i32
%0 = util.do_not_optimize(%c13) : index
%1 = util.do_not_optimize(%c14) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c1579724232_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_13x14_times_random_14x2_plus_zero_accumulator() {
%c13 = constant 13 : index
%c14 = constant 14 : index
%c2 = constant 2 : index
%c2019065196_i32 = constant 2019065196 : i32
%0 = util.do_not_optimize(%c13) : index
%1 = util.do_not_optimize(%c14) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2019065196_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_13x14_times_identity_14x2_plus_random_accumulator() {
%c13 = constant 13 : index
%c14 = constant 14 : index
%c2 = constant 2 : index
%c898240668_i32 = constant 898240668 : i32
%0 = util.do_not_optimize(%c13) : index
%1 = util.do_not_optimize(%c14) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c898240668_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_13x14_times_random_14x2_plus_random_accumulator() {
%c13 = constant 13 : index
%c14 = constant 14 : index
%c2 = constant 2 : index
%c1280452098_i32 = constant 1280452098 : i32
%c1976378251_i32 = constant 1976378251 : i32
%c1941019693_i32 = constant 1941019693 : i32
%0 = util.do_not_optimize(%c13) : index
%1 = util.do_not_optimize(%c14) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c1280452098_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1976378251_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1941019693_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_13x14_times_random_14x2_plus_random_accumulator() {
%c13 = constant 13 : index
%c14 = constant 14 : index
%c2 = constant 2 : index
%c250082193_i32 = constant 250082193 : i32
%c711958516_i32 = constant 711958516 : i32
%c768722895_i32 = constant 768722895 : i32
%0 = util.do_not_optimize(%c13) : index
%1 = util.do_not_optimize(%c14) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c250082193_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c711958516_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c768722895_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<13x14xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<14x2xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<13x2xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<13x14xf32>, tensor<14x2xf32>) outs(%8 : tensor<13x2xf32>) -> tensor<13x2xf32>
%10 = tensor.cast %9 : tensor<13x2xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_13x14_times_random_14x2_plus_random_accumulator() {
%c13 = constant 13 : index
%c14 = constant 14 : index
%c2 = constant 2 : index
%c652928032_i32 = constant 652928032 : i32
%c1019029300_i32 = constant 1019029300 : i32
%c1450405765_i32 = constant 1450405765 : i32
%0 = util.do_not_optimize(%c13) : index
%1 = util.do_not_optimize(%c14) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c652928032_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1019029300_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1450405765_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %4 : tensor<?x?xf32> to tensor<14x?xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x2xf32>
%8 = linalg.matmul ins(%3, %6 : tensor<?x?xf32>, tensor<14x?xf32>) outs(%7 : tensor<?x2xf32>) -> tensor<?x2xf32>
%9 = tensor.cast %8 : tensor<?x2xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_100x100_times_identity_100x100_plus_zero_accumulator() {
%c100 = constant 100 : index
%0 = util.do_not_optimize(%c100) : index
%1 = util.do_not_optimize(%c100) : index
%2 = util.do_not_optimize(%c100) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_100x100_times_identity_100x100_plus_zero_accumulator() {
%c100 = constant 100 : index
%c446960277_i32 = constant 446960277 : i32
%0 = util.do_not_optimize(%c100) : index
%1 = util.do_not_optimize(%c100) : index
%2 = util.do_not_optimize(%c100) : index
%3 = call @random_matrix(%0, %1, %c446960277_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_100x100_times_random_100x100_plus_zero_accumulator() {
%c100 = constant 100 : index
%c1598813305_i32 = constant 1598813305 : i32
%0 = util.do_not_optimize(%c100) : index
%1 = util.do_not_optimize(%c100) : index
%2 = util.do_not_optimize(%c100) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1598813305_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_100x100_times_identity_100x100_plus_random_accumulator() {
%c100 = constant 100 : index
%c49739769_i32 = constant 49739769 : i32
%0 = util.do_not_optimize(%c100) : index
%1 = util.do_not_optimize(%c100) : index
%2 = util.do_not_optimize(%c100) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c49739769_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_100x100_times_random_100x100_plus_random_accumulator() {
%c100 = constant 100 : index
%c101672053_i32 = constant 101672053 : i32
%c811536968_i32 = constant 811536968 : i32
%c1451777401_i32 = constant 1451777401 : i32
%0 = util.do_not_optimize(%c100) : index
%1 = util.do_not_optimize(%c100) : index
%2 = util.do_not_optimize(%c100) : index
%3 = call @random_matrix(%0, %1, %c101672053_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c811536968_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1451777401_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_100x100_times_random_100x100_plus_random_accumulator() {
%c100 = constant 100 : index
%c2060554767_i32 = constant 2060554767 : i32
%c39079758_i32 = constant 39079758 : i32
%c928356352_i32 = constant 928356352 : i32
%0 = util.do_not_optimize(%c100) : index
%1 = util.do_not_optimize(%c100) : index
%2 = util.do_not_optimize(%c100) : index
%3 = call @random_matrix(%0, %1, %c2060554767_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c39079758_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c928356352_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<100x100xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<100x100xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<100x100xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<100x100xf32>, tensor<100x100xf32>) outs(%8 : tensor<100x100xf32>) -> tensor<100x100xf32>
%10 = tensor.cast %9 : tensor<100x100xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_100x100_times_random_100x100_plus_random_accumulator() {
%c100 = constant 100 : index
%c1148205443_i32 = constant 1148205443 : i32
%c619493630_i32 = constant 619493630 : i32
%c2014712902_i32 = constant 2014712902 : i32
%0 = util.do_not_optimize(%c100) : index
%1 = util.do_not_optimize(%c100) : index
%2 = util.do_not_optimize(%c100) : index
%3 = call @random_matrix(%0, %1, %c1148205443_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c619493630_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2014712902_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<100x?xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<100x?xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x100xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<100x?xf32>, tensor<100x?xf32>) outs(%8 : tensor<?x100xf32>) -> tensor<?x100xf32>
%10 = tensor.cast %9 : tensor<?x100xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_101x102_times_identity_102x103_plus_zero_accumulator() {
%c101 = constant 101 : index
%c102 = constant 102 : index
%c103 = constant 103 : index
%0 = util.do_not_optimize(%c101) : index
%1 = util.do_not_optimize(%c102) : index
%2 = util.do_not_optimize(%c103) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_101x102_times_identity_102x103_plus_zero_accumulator() {
%c101 = constant 101 : index
%c102 = constant 102 : index
%c103 = constant 103 : index
%c361411483_i32 = constant 361411483 : i32
%0 = util.do_not_optimize(%c101) : index
%1 = util.do_not_optimize(%c102) : index
%2 = util.do_not_optimize(%c103) : index
%3 = call @random_matrix(%0, %1, %c361411483_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_101x102_times_random_102x103_plus_zero_accumulator() {
%c101 = constant 101 : index
%c102 = constant 102 : index
%c103 = constant 103 : index
%c1684031312_i32 = constant 1684031312 : i32
%0 = util.do_not_optimize(%c101) : index
%1 = util.do_not_optimize(%c102) : index
%2 = util.do_not_optimize(%c103) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1684031312_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_101x102_times_identity_102x103_plus_random_accumulator() {
%c101 = constant 101 : index
%c102 = constant 102 : index
%c103 = constant 103 : index
%c1176971661_i32 = constant 1176971661 : i32
%0 = util.do_not_optimize(%c101) : index
%1 = util.do_not_optimize(%c102) : index
%2 = util.do_not_optimize(%c103) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1176971661_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_101x102_times_random_102x103_plus_random_accumulator() {
%c101 = constant 101 : index
%c102 = constant 102 : index
%c103 = constant 103 : index
%c1919166746_i32 = constant 1919166746 : i32
%c1948431880_i32 = constant 1948431880 : i32
%c1561475468_i32 = constant 1561475468 : i32
%0 = util.do_not_optimize(%c101) : index
%1 = util.do_not_optimize(%c102) : index
%2 = util.do_not_optimize(%c103) : index
%3 = call @random_matrix(%0, %1, %c1919166746_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1948431880_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1561475468_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_101x102_times_random_102x103_plus_random_accumulator() {
%c101 = constant 101 : index
%c102 = constant 102 : index
%c103 = constant 103 : index
%c1601273422_i32 = constant 1601273422 : i32
%c690446891_i32 = constant 690446891 : i32
%c1763157668_i32 = constant 1763157668 : i32
%0 = util.do_not_optimize(%c101) : index
%1 = util.do_not_optimize(%c102) : index
%2 = util.do_not_optimize(%c103) : index
%3 = call @random_matrix(%0, %1, %c1601273422_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c690446891_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1763157668_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<101x102xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<102x103xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<101x103xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<101x102xf32>, tensor<102x103xf32>) outs(%8 : tensor<101x103xf32>) -> tensor<101x103xf32>
%10 = tensor.cast %9 : tensor<101x103xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_101x102_times_random_102x103_plus_random_accumulator() {
%c101 = constant 101 : index
%c102 = constant 102 : index
%c103 = constant 103 : index
%c311894124_i32 = constant 311894124 : i32
%c1580894134_i32 = constant 1580894134 : i32
%c509346169_i32 = constant 509346169 : i32
%0 = util.do_not_optimize(%c101) : index
%1 = util.do_not_optimize(%c102) : index
%2 = util.do_not_optimize(%c103) : index
%3 = call @random_matrix(%0, %1, %c311894124_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1580894134_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c509346169_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %4 : tensor<?x?xf32> to tensor<102x?xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<101x103xf32>
%8 = linalg.matmul ins(%3, %6 : tensor<?x?xf32>, tensor<102x?xf32>) outs(%7 : tensor<101x103xf32>) -> tensor<101x103xf32>
%9 = tensor.cast %8 : tensor<101x103xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10000x1_times_identity_1x1_plus_zero_accumulator() {
%c10000 = constant 10000 : index
%c1 = constant 1 : index
%0 = util.do_not_optimize(%c10000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_10000x1_times_identity_1x1_plus_zero_accumulator() {
%c10000 = constant 10000 : index
%c1 = constant 1 : index
%c359319148_i32 = constant 359319148 : i32
%0 = util.do_not_optimize(%c10000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c359319148_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10000x1_times_random_1x1_plus_zero_accumulator() {
%c10000 = constant 10000 : index
%c1 = constant 1 : index
%c1616659936_i32 = constant 1616659936 : i32
%0 = util.do_not_optimize(%c10000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1616659936_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_10000x1_times_identity_1x1_plus_random_accumulator() {
%c10000 = constant 10000 : index
%c1 = constant 1 : index
%c383522323_i32 = constant 383522323 : i32
%0 = util.do_not_optimize(%c10000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c383522323_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_10000x1_times_random_1x1_plus_random_accumulator() {
%c10000 = constant 10000 : index
%c1 = constant 1 : index
%c1697016393_i32 = constant 1697016393 : i32
%c914591688_i32 = constant 914591688 : i32
%c286556422_i32 = constant 286556422 : i32
%0 = util.do_not_optimize(%c10000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1697016393_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c914591688_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c286556422_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_10000x1_times_random_1x1_plus_random_accumulator() {
%c10000 = constant 10000 : index
%c1 = constant 1 : index
%c422876035_i32 = constant 422876035 : i32
%c817020750_i32 = constant 817020750 : i32
%c2018929742_i32 = constant 2018929742 : i32
%0 = util.do_not_optimize(%c10000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c422876035_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c817020750_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2018929742_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<10000x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1x1xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<10000x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<10000x1xf32>, tensor<1x1xf32>) outs(%8 : tensor<10000x1xf32>) -> tensor<10000x1xf32>
%10 = tensor.cast %9 : tensor<10000x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_10000x1_times_random_1x1_plus_random_accumulator() {
%c10000 = constant 10000 : index
%c1 = constant 1 : index
%c802191575_i32 = constant 802191575 : i32
%c1311877768_i32 = constant 1311877768 : i32
%c653956392_i32 = constant 653956392 : i32
%0 = util.do_not_optimize(%c10000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c802191575_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1311877768_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c653956392_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<10000x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<?x1xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<10000x1xf32>, tensor<?x1xf32>) outs(%8 : tensor<?x1xf32>) -> tensor<?x1xf32>
%10 = tensor.cast %9 : tensor<?x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x10000_times_identity_10000x1_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x10000_times_identity_10000x1_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c2018180155_i32 = constant 2018180155 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c2018180155_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x10000_times_random_10000x1_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c1126099497_i32 = constant 1126099497 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1126099497_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x10000_times_identity_10000x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c842746823_i32 = constant 842746823 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c842746823_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x10000_times_random_10000x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c449167912_i32 = constant 449167912 : i32
%c789380040_i32 = constant 789380040 : i32
%c1361562119_i32 = constant 1361562119 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c449167912_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c789380040_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1361562119_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1x10000_times_random_10000x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c228029814_i32 = constant 228029814 : i32
%c1373460719_i32 = constant 1373460719 : i32
%c1207216665_i32 = constant 1207216665 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c228029814_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1373460719_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1207216665_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x10000xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<10000x1xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1x10000xf32>, tensor<10000x1xf32>) outs(%8 : tensor<1x1xf32>) -> tensor<1x1xf32>
%10 = tensor.cast %9 : tensor<1x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1x10000_times_random_10000x1_plus_random_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c1586874870_i32 = constant 1586874870 : i32
%c1442644927_i32 = constant 1442644927 : i32
%c1461049948_i32 = constant 1461049948 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c10000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1586874870_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1442644927_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1461049948_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %4 : tensor<?x?xf32> to tensor<10000x?xf32>
%7 = linalg.matmul ins(%3, %6 : tensor<?x?xf32>, tensor<10000x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%8 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%7, %8) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1_times_identity_1x10000_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10000) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x1_times_identity_1x10000_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c260160181_i32 = constant 260160181 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10000) : index
%3 = call @random_matrix(%0, %1, %c260160181_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1_times_random_1x10000_plus_zero_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c1855213042_i32 = constant 1855213042 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10000) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1855213042_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1_times_identity_1x10000_plus_random_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c773186835_i32 = constant 773186835 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10000) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c773186835_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x1_times_random_1x10000_plus_random_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c1383411072_i32 = constant 1383411072 : i32
%c484369400_i32 = constant 484369400 : i32
%c1340842511_i32 = constant 1340842511 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10000) : index
%3 = call @random_matrix(%0, %1, %c1383411072_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c484369400_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1340842511_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1x1_times_random_1x10000_plus_random_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c799211548_i32 = constant 799211548 : i32
%c1344398800_i32 = constant 1344398800 : i32
%c666146107_i32 = constant 666146107 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10000) : index
%3 = call @random_matrix(%0, %1, %c799211548_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1344398800_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c666146107_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1x10000xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1x10000xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1x1xf32>, tensor<1x10000xf32>) outs(%8 : tensor<1x10000xf32>) -> tensor<1x10000xf32>
%10 = tensor.cast %9 : tensor<1x10000xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1x1_times_random_1x10000_plus_random_accumulator() {
%c1 = constant 1 : index
%c10000 = constant 10000 : index
%c1266084466_i32 = constant 1266084466 : i32
%c2073631960_i32 = constant 2073631960 : i32
%c2075554490_i32 = constant 2075554490 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c10000) : index
%3 = call @random_matrix(%0, %1, %c1266084466_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2073631960_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2075554490_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<?x1xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x10000xf32>
%8 = linalg.matmul ins(%6, %4 : tensor<?x1xf32>, tensor<?x?xf32>) outs(%7 : tensor<?x10000xf32>) -> tensor<?x10000xf32>
%9 = tensor.cast %8 : tensor<?x10000xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1000_times_identity_1000x1000_plus_zero_accumulator() {
%c1 = constant 1 : index
%c1000 = constant 1000 : index
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x1000_times_identity_1000x1000_plus_zero_accumulator() {
%c1 = constant 1 : index
%c1000 = constant 1000 : index
%c198112442_i32 = constant 198112442 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @random_matrix(%0, %1, %c198112442_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1000_times_random_1000x1000_plus_zero_accumulator() {
%c1 = constant 1 : index
%c1000 = constant 1000 : index
%c341007691_i32 = constant 341007691 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c341007691_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1x1000_times_identity_1000x1000_plus_random_accumulator() {
%c1 = constant 1 : index
%c1000 = constant 1000 : index
%c320098006_i32 = constant 320098006 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c320098006_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1x1000_times_random_1000x1000_plus_random_accumulator() {
%c1 = constant 1 : index
%c1000 = constant 1000 : index
%c306007461_i32 = constant 306007461 : i32
%c893625865_i32 = constant 893625865 : i32
%c1857595773_i32 = constant 1857595773 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @random_matrix(%0, %1, %c306007461_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c893625865_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1857595773_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1x1000_times_random_1000x1000_plus_random_accumulator() {
%c1 = constant 1 : index
%c1000 = constant 1000 : index
%c1973361645_i32 = constant 1973361645 : i32
%c207835816_i32 = constant 207835816 : i32
%c1546558999_i32 = constant 1546558999 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @random_matrix(%0, %1, %c1973361645_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c207835816_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1546558999_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1x1000xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1000x1000xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1x1000xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1x1000xf32>, tensor<1000x1000xf32>) outs(%8 : tensor<1x1000xf32>) -> tensor<1x1000xf32>
%10 = tensor.cast %9 : tensor<1x1000xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1x1000_times_random_1000x1000_plus_random_accumulator() {
%c1 = constant 1 : index
%c1000 = constant 1000 : index
%c975420068_i32 = constant 975420068 : i32
%c923141953_i32 = constant 923141953 : i32
%c699538013_i32 = constant 699538013 : i32
%0 = util.do_not_optimize(%c1) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @random_matrix(%0, %1, %c975420068_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c923141953_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c699538013_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<?x1000xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1000x?xf32>
%8 = linalg.matmul ins(%6, %7 : tensor<?x1000xf32>, tensor<1000x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%9 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%8, %9) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1000x1_times_identity_1x1000_plus_zero_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1000x1_times_identity_1x1000_plus_zero_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c1677512985_i32 = constant 1677512985 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @random_matrix(%0, %1, %c1677512985_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1000x1_times_random_1x1000_plus_zero_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c63421506_i32 = constant 63421506 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c63421506_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1000x1_times_identity_1x1000_plus_random_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c1255319151_i32 = constant 1255319151 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1255319151_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1000x1_times_random_1x1000_plus_random_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c2112154169_i32 = constant 2112154169 : i32
%c1860266827_i32 = constant 1860266827 : i32
%c2058790459_i32 = constant 2058790459 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @random_matrix(%0, %1, %c2112154169_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1860266827_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2058790459_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1000x1_times_random_1x1000_plus_random_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c773514170_i32 = constant 773514170 : i32
%c4329681_i32 = constant 4329681 : i32
%c692117792_i32 = constant 692117792 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @random_matrix(%0, %1, %c773514170_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c4329681_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c692117792_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1000x1xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1x1000xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1000x1000xf32>
%9 = linalg.tensor_expand_shape %6 [[0, 1], [2, 3]] : tensor<1000x1xf32> into tensor<125x8x1x1xf32>
%10 = linalg.tensor_expand_shape %7 [[0, 1], [2, 3]] : tensor<1x1000xf32> into tensor<1x1x125x8xf32>
%11 = linalg.tensor_expand_shape %8 [[0, 1], [2, 3]] : tensor<1000x1000xf32> into tensor<125x8x125x8xf32>
%12 = linalg.init_tensor [125, 1, 8, 1] : tensor<125x1x8x1xf32>
%13 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%9 : tensor<125x8x1x1xf32>) outs(%12 : tensor<125x1x8x1xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<125x1x8x1xf32>
%14 = linalg.init_tensor [125, 1, 8, 1] : tensor<125x1x8x1xf32>
%15 = linalg.generic {indexing_maps = [#map6, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%10 : tensor<1x1x125x8xf32>) outs(%14 : tensor<125x1x8x1xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<125x1x8x1xf32>
%16 = linalg.init_tensor [125, 125, 8, 8] : tensor<125x125x8x8xf32>
%17 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%11 : tensor<125x8x125x8xf32>) outs(%16 : tensor<125x125x8x8xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<125x125x8x8xf32>
%18 = linalg.mmt4d ins(%13, %15 : tensor<125x1x8x1xf32>, tensor<125x1x8x1xf32>) outs(%17 : tensor<125x125x8x8xf32>) -> tensor<125x125x8x8xf32>
%19 = linalg.init_tensor [125, 8, 125, 8] : tensor<125x8x125x8xf32>
%20 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%18 : tensor<125x125x8x8xf32>) outs(%19 : tensor<125x8x125x8xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<125x8x125x8xf32>
%21 = linalg.tensor_collapse_shape %20 [[0, 1], [2, 3]] : tensor<125x8x125x8xf32> into tensor<1000x1000xf32>
%22 = tensor.cast %21 : tensor<1000x1000xf32> to tensor<?x?xf32>
%23 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%22, %23) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1000x1_times_random_1x1000_plus_random_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c814841253_i32 = constant 814841253 : i32
%c2039128758_i32 = constant 2039128758 : i32
%c871317173_i32 = constant 871317173 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1) : index
%2 = util.do_not_optimize(%c1000) : index
%3 = call @random_matrix(%0, %1, %c814841253_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2039128758_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c871317173_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %5 : tensor<?x?xf32> to tensor<1000x1000xf32>
%7 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%6 : tensor<1000x1000xf32>) -> tensor<1000x1000xf32>
%8 = tensor.cast %7 : tensor<1000x1000xf32> to tensor<?x?xf32>
%9 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%8, %9) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1000x1000_times_identity_1000x1_plus_zero_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1000x1000_times_identity_1000x1_plus_zero_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c594744340_i32 = constant 594744340 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c594744340_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1000x1000_times_random_1000x1_plus_zero_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c1342643044_i32 = constant 1342643044 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1342643044_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1000x1000_times_identity_1000x1_plus_random_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c1813394111_i32 = constant 1813394111 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1813394111_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1000x1000_times_random_1000x1_plus_random_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c766196714_i32 = constant 766196714 : i32
%c1118212860_i32 = constant 1118212860 : i32
%c251497715_i32 = constant 251497715 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c766196714_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1118212860_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c251497715_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1000x1000_times_random_1000x1_plus_random_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c321144274_i32 = constant 321144274 : i32
%c1418286208_i32 = constant 1418286208 : i32
%c314880008_i32 = constant 314880008 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c321144274_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1418286208_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c314880008_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1000x1000xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1000x1xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1000x1xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1000x1000xf32>, tensor<1000x1xf32>) outs(%8 : tensor<1000x1xf32>) -> tensor<1000x1xf32>
%10 = tensor.cast %9 : tensor<1000x1xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1000x1000_times_random_1000x1_plus_random_accumulator() {
%c1000 = constant 1000 : index
%c1 = constant 1 : index
%c1831096349_i32 = constant 1831096349 : i32
%c572435706_i32 = constant 572435706 : i32
%c371878377_i32 = constant 371878377 : i32
%0 = util.do_not_optimize(%c1000) : index
%1 = util.do_not_optimize(%c1000) : index
%2 = util.do_not_optimize(%c1) : index
%3 = call @random_matrix(%0, %1, %c1831096349_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c572435706_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c371878377_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %4 : tensor<?x?xf32> to tensor<1000x1xf32>
%7 = linalg.matmul ins(%3, %6 : tensor<?x?xf32>, tensor<1000x1xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%8 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%7, %8) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1300x1300_times_identity_1300x2_plus_zero_accumulator() {
%c1300 = constant 1300 : index
%c2 = constant 2 : index
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1300x1300_times_identity_1300x2_plus_zero_accumulator() {
%c1300 = constant 1300 : index
%c2 = constant 2 : index
%c1472396366_i32 = constant 1472396366 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c1472396366_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1300x1300_times_random_1300x2_plus_zero_accumulator() {
%c1300 = constant 1300 : index
%c2 = constant 2 : index
%c926202074_i32 = constant 926202074 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c926202074_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1300x1300_times_identity_1300x2_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c2 = constant 2 : index
%c238267161_i32 = constant 238267161 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c238267161_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1300x1300_times_random_1300x2_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c2 = constant 2 : index
%c1619198946_i32 = constant 1619198946 : i32
%c537506154_i32 = constant 537506154 : i32
%c62136680_i32 = constant 62136680 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c1619198946_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c537506154_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c62136680_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1300x1300_times_random_1300x2_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c2 = constant 2 : index
%c1512509068_i32 = constant 1512509068 : i32
%c176190722_i32 = constant 176190722 : i32
%c867099542_i32 = constant 867099542 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c1512509068_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c176190722_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c867099542_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1300x1300xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1300x2xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1300x2xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1300x1300xf32>, tensor<1300x2xf32>) outs(%8 : tensor<1300x2xf32>) -> tensor<1300x2xf32>
%10 = tensor.cast %9 : tensor<1300x2xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1300x1300_times_random_1300x2_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c2 = constant 2 : index
%c1305711852_i32 = constant 1305711852 : i32
%c1519252089_i32 = constant 1519252089 : i32
%c1398526716_i32 = constant 1398526716 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c2) : index
%3 = call @random_matrix(%0, %1, %c1305711852_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1519252089_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1398526716_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1300x1300xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x2xf32>
%8 = linalg.matmul ins(%6, %4 : tensor<1300x1300xf32>, tensor<?x?xf32>) outs(%7 : tensor<?x2xf32>) -> tensor<?x2xf32>
%9 = tensor.cast %8 : tensor<?x2xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1300x1300_times_identity_1300x3_plus_zero_accumulator() {
%c1300 = constant 1300 : index
%c3 = constant 3 : index
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1300x1300_times_identity_1300x3_plus_zero_accumulator() {
%c1300 = constant 1300 : index
%c3 = constant 3 : index
%c413030420_i32 = constant 413030420 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @random_matrix(%0, %1, %c413030420_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1300x1300_times_random_1300x3_plus_zero_accumulator() {
%c1300 = constant 1300 : index
%c3 = constant 3 : index
%c153225072_i32 = constant 153225072 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c153225072_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1300x1300_times_identity_1300x3_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c3 = constant 3 : index
%c393770244_i32 = constant 393770244 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c393770244_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1300x1300_times_random_1300x3_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c3 = constant 3 : index
%c305688527_i32 = constant 305688527 : i32
%c530748280_i32 = constant 530748280 : i32
%c270315170_i32 = constant 270315170 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @random_matrix(%0, %1, %c305688527_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c530748280_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c270315170_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1300x1300_times_random_1300x3_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c3 = constant 3 : index
%c272931898_i32 = constant 272931898 : i32
%c2030957660_i32 = constant 2030957660 : i32
%c1581236663_i32 = constant 1581236663 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @random_matrix(%0, %1, %c272931898_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c2030957660_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1581236663_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1300x1300xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1300x3xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1300x3xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1300x1300xf32>, tensor<1300x3xf32>) outs(%8 : tensor<1300x3xf32>) -> tensor<1300x3xf32>
%10 = tensor.cast %9 : tensor<1300x3xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1300x1300_times_random_1300x3_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c3 = constant 3 : index
%c2011177999_i32 = constant 2011177999 : i32
%c279959800_i32 = constant 279959800 : i32
%c1972398876_i32 = constant 1972398876 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c3) : index
%3 = call @random_matrix(%0, %1, %c2011177999_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c279959800_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1972398876_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %4 : tensor<?x?xf32> to tensor<1300x3xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<1300x3xf32>
%8 = linalg.matmul ins(%3, %6 : tensor<?x?xf32>, tensor<1300x3xf32>) outs(%7 : tensor<1300x3xf32>) -> tensor<1300x3xf32>
%9 = tensor.cast %8 : tensor<1300x3xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1300x1300_times_identity_1300x4_plus_zero_accumulator() {
%c1300 = constant 1300 : index
%c4 = constant 4 : index
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1300x1300_times_identity_1300x4_plus_zero_accumulator() {
%c1300 = constant 1300 : index
%c4 = constant 4 : index
%c1621567844_i32 = constant 1621567844 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c1621567844_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1300x1300_times_random_1300x4_plus_zero_accumulator() {
%c1300 = constant 1300 : index
%c4 = constant 4 : index
%c1069948221_i32 = constant 1069948221 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1069948221_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1300x1300_times_identity_1300x4_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c4 = constant 4 : index
%c488865541_i32 = constant 488865541 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c488865541_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1300x1300_times_random_1300x4_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c4 = constant 4 : index
%c1478216375_i32 = constant 1478216375 : i32
%c543498756_i32 = constant 543498756 : i32
%c1568219124_i32 = constant 1568219124 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c1478216375_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c543498756_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1568219124_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1300x1300_times_random_1300x4_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c4 = constant 4 : index
%c706777854_i32 = constant 706777854 : i32
%c1948574192_i32 = constant 1948574192 : i32
%c1988567079_i32 = constant 1988567079 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c706777854_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1948574192_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1988567079_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1300x1300xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<1300x4xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1300x4xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1300x1300xf32>, tensor<1300x4xf32>) outs(%8 : tensor<1300x4xf32>) -> tensor<1300x4xf32>
%10 = tensor.cast %9 : tensor<1300x4xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1300x1300_times_random_1300x4_plus_random_accumulator() {
%c1300 = constant 1300 : index
%c4 = constant 4 : index
%c1897416803_i32 = constant 1897416803 : i32
%c28953063_i32 = constant 28953063 : i32
%c1728933523_i32 = constant 1728933523 : i32
%0 = util.do_not_optimize(%c1300) : index
%1 = util.do_not_optimize(%c1300) : index
%2 = util.do_not_optimize(%c4) : index
%3 = call @random_matrix(%0, %1, %c1897416803_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c28953063_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1728933523_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1300x1300xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<1300x?xf32>
%8 = linalg.matmul ins(%6, %4 : tensor<1300x1300xf32>, tensor<?x?xf32>) outs(%7 : tensor<1300x?xf32>) -> tensor<1300x?xf32>
%9 = tensor.cast %8 : tensor<1300x?xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_256x256_times_identity_256x512_plus_zero_accumulator() {
%c256 = constant 256 : index
%c512 = constant 512 : index
%0 = util.do_not_optimize(%c256) : index
%1 = util.do_not_optimize(%c256) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_256x256_times_identity_256x512_plus_zero_accumulator() {
%c256 = constant 256 : index
%c512 = constant 512 : index
%c2013697848_i32 = constant 2013697848 : i32
%0 = util.do_not_optimize(%c256) : index
%1 = util.do_not_optimize(%c256) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @random_matrix(%0, %1, %c2013697848_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_256x256_times_random_256x512_plus_zero_accumulator() {
%c256 = constant 256 : index
%c512 = constant 512 : index
%c1656506647_i32 = constant 1656506647 : i32
%0 = util.do_not_optimize(%c256) : index
%1 = util.do_not_optimize(%c256) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1656506647_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_256x256_times_identity_256x512_plus_random_accumulator() {
%c256 = constant 256 : index
%c512 = constant 512 : index
%c1826244939_i32 = constant 1826244939 : i32
%0 = util.do_not_optimize(%c256) : index
%1 = util.do_not_optimize(%c256) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1826244939_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_256x256_times_random_256x512_plus_random_accumulator() {
%c256 = constant 256 : index
%c512 = constant 512 : index
%c465741119_i32 = constant 465741119 : i32
%c1930738453_i32 = constant 1930738453 : i32
%c33068610_i32 = constant 33068610 : i32
%0 = util.do_not_optimize(%c256) : index
%1 = util.do_not_optimize(%c256) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @random_matrix(%0, %1, %c465741119_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1930738453_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c33068610_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_256x256_times_random_256x512_plus_random_accumulator() {
%c256 = constant 256 : index
%c512 = constant 512 : index
%c674523589_i32 = constant 674523589 : i32
%c1928592452_i32 = constant 1928592452 : i32
%c1670153042_i32 = constant 1670153042 : i32
%0 = util.do_not_optimize(%c256) : index
%1 = util.do_not_optimize(%c256) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @random_matrix(%0, %1, %c674523589_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1928592452_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1670153042_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<256x256xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<256x512xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<256x512xf32>
%9 = linalg.tensor_expand_shape %6 [[0, 1], [2, 3]] : tensor<256x256xf32> into tensor<32x8x256x1xf32>
%10 = linalg.tensor_expand_shape %7 [[0, 1], [2, 3]] : tensor<256x512xf32> into tensor<256x1x64x8xf32>
%11 = linalg.tensor_expand_shape %8 [[0, 1], [2, 3]] : tensor<256x512xf32> into tensor<32x8x64x8xf32>
%12 = linalg.init_tensor [32, 256, 8, 1] : tensor<32x256x8x1xf32>
%13 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%9 : tensor<32x8x256x1xf32>) outs(%12 : tensor<32x256x8x1xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<32x256x8x1xf32>
%14 = linalg.init_tensor [64, 256, 8, 1] : tensor<64x256x8x1xf32>
%15 = linalg.generic {indexing_maps = [#map6, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%10 : tensor<256x1x64x8xf32>) outs(%14 : tensor<64x256x8x1xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<64x256x8x1xf32>
%16 = linalg.init_tensor [32, 64, 8, 8] : tensor<32x64x8x8xf32>
%17 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%11 : tensor<32x8x64x8xf32>) outs(%16 : tensor<32x64x8x8xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<32x64x8x8xf32>
%18 = linalg.mmt4d ins(%13, %15 : tensor<32x256x8x1xf32>, tensor<64x256x8x1xf32>) outs(%17 : tensor<32x64x8x8xf32>) -> tensor<32x64x8x8xf32>
%19 = linalg.init_tensor [32, 8, 64, 8] : tensor<32x8x64x8xf32>
%20 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%18 : tensor<32x64x8x8xf32>) outs(%19 : tensor<32x8x64x8xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<32x8x64x8xf32>
%21 = linalg.tensor_collapse_shape %20 [[0, 1], [2, 3]] : tensor<32x8x64x8xf32> into tensor<256x512xf32>
%22 = tensor.cast %21 : tensor<256x512xf32> to tensor<?x?xf32>
%23 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%22, %23) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_256x256_times_random_256x512_plus_random_accumulator() {
%c256 = constant 256 : index
%c512 = constant 512 : index
%c1273898355_i32 = constant 1273898355 : i32
%c1300746007_i32 = constant 1300746007 : i32
%c183632911_i32 = constant 183632911 : i32
%0 = util.do_not_optimize(%c256) : index
%1 = util.do_not_optimize(%c256) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @random_matrix(%0, %1, %c1273898355_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1300746007_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c183632911_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<256x?xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x512xf32>
%8 = linalg.matmul ins(%6, %4 : tensor<256x?xf32>, tensor<?x?xf32>) outs(%7 : tensor<?x512xf32>) -> tensor<?x512xf32>
%9 = tensor.cast %8 : tensor<?x512xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_512x512_times_identity_512x128_plus_zero_accumulator() {
%c512 = constant 512 : index
%c128 = constant 128 : index
%0 = util.do_not_optimize(%c512) : index
%1 = util.do_not_optimize(%c512) : index
%2 = util.do_not_optimize(%c128) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_512x512_times_identity_512x128_plus_zero_accumulator() {
%c512 = constant 512 : index
%c128 = constant 128 : index
%c1474242348_i32 = constant 1474242348 : i32
%0 = util.do_not_optimize(%c512) : index
%1 = util.do_not_optimize(%c512) : index
%2 = util.do_not_optimize(%c128) : index
%3 = call @random_matrix(%0, %1, %c1474242348_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_512x512_times_random_512x128_plus_zero_accumulator() {
%c512 = constant 512 : index
%c128 = constant 128 : index
%c1986769669_i32 = constant 1986769669 : i32
%0 = util.do_not_optimize(%c512) : index
%1 = util.do_not_optimize(%c512) : index
%2 = util.do_not_optimize(%c128) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1986769669_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_512x512_times_identity_512x128_plus_random_accumulator() {
%c512 = constant 512 : index
%c128 = constant 128 : index
%c1033984573_i32 = constant 1033984573 : i32
%0 = util.do_not_optimize(%c512) : index
%1 = util.do_not_optimize(%c512) : index
%2 = util.do_not_optimize(%c128) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1033984573_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_512x512_times_random_512x128_plus_random_accumulator() {
%c512 = constant 512 : index
%c128 = constant 128 : index
%c1801883356_i32 = constant 1801883356 : i32
%c1328806682_i32 = constant 1328806682 : i32
%c1785778226_i32 = constant 1785778226 : i32
%0 = util.do_not_optimize(%c512) : index
%1 = util.do_not_optimize(%c512) : index
%2 = util.do_not_optimize(%c128) : index
%3 = call @random_matrix(%0, %1, %c1801883356_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1328806682_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1785778226_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_512x512_times_random_512x128_plus_random_accumulator() {
%c512 = constant 512 : index
%c128 = constant 128 : index
%c1307156666_i32 = constant 1307156666 : i32
%c394908332_i32 = constant 394908332 : i32
%c1555243200_i32 = constant 1555243200 : i32
%0 = util.do_not_optimize(%c512) : index
%1 = util.do_not_optimize(%c512) : index
%2 = util.do_not_optimize(%c128) : index
%3 = call @random_matrix(%0, %1, %c1307156666_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c394908332_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1555243200_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<512x512xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<512x128xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<512x128xf32>
%9 = linalg.tensor_expand_shape %6 [[0, 1], [2, 3]] : tensor<512x512xf32> into tensor<64x8x512x1xf32>
%10 = linalg.tensor_expand_shape %7 [[0, 1], [2, 3]] : tensor<512x128xf32> into tensor<512x1x16x8xf32>
%11 = linalg.tensor_expand_shape %8 [[0, 1], [2, 3]] : tensor<512x128xf32> into tensor<64x8x16x8xf32>
%12 = linalg.init_tensor [64, 512, 8, 1] : tensor<64x512x8x1xf32>
%13 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%9 : tensor<64x8x512x1xf32>) outs(%12 : tensor<64x512x8x1xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<64x512x8x1xf32>
%14 = linalg.init_tensor [16, 512, 8, 1] : tensor<16x512x8x1xf32>
%15 = linalg.generic {indexing_maps = [#map6, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%10 : tensor<512x1x16x8xf32>) outs(%14 : tensor<16x512x8x1xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<16x512x8x1xf32>
%16 = linalg.init_tensor [64, 16, 8, 8] : tensor<64x16x8x8xf32>
%17 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%11 : tensor<64x8x16x8xf32>) outs(%16 : tensor<64x16x8x8xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<64x16x8x8xf32>
%18 = linalg.mmt4d ins(%13, %15 : tensor<64x512x8x1xf32>, tensor<16x512x8x1xf32>) outs(%17 : tensor<64x16x8x8xf32>) -> tensor<64x16x8x8xf32>
%19 = linalg.init_tensor [64, 8, 16, 8] : tensor<64x8x16x8xf32>
%20 = linalg.generic {indexing_maps = [#map4, #map5], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%18 : tensor<64x16x8x8xf32>) outs(%19 : tensor<64x8x16x8xf32>) {
^bb0(%arg0: f32, %arg1: f32): // no predecessors
linalg.yield %arg0 : f32
} -> tensor<64x8x16x8xf32>
%21 = linalg.tensor_collapse_shape %20 [[0, 1], [2, 3]] : tensor<64x8x16x8xf32> into tensor<512x128xf32>
%22 = tensor.cast %21 : tensor<512x128xf32> to tensor<?x?xf32>
%23 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%22, %23) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_512x512_times_random_512x128_plus_random_accumulator() {
%c512 = constant 512 : index
%c128 = constant 128 : index
%c1411175374_i32 = constant 1411175374 : i32
%c665195514_i32 = constant 665195514 : i32
%c477166350_i32 = constant 477166350 : i32
%0 = util.do_not_optimize(%c512) : index
%1 = util.do_not_optimize(%c512) : index
%2 = util.do_not_optimize(%c128) : index
%3 = call @random_matrix(%0, %1, %c1411175374_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c665195514_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c477166350_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<512x?xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<512x128xf32>
%8 = linalg.matmul ins(%6, %7 : tensor<512x?xf32>, tensor<512x128xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%9 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%8, %9) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_127x63_times_identity_63x511_plus_zero_accumulator() {
%c127 = constant 127 : index
%c63 = constant 63 : index
%c511 = constant 511 : index
%0 = util.do_not_optimize(%c127) : index
%1 = util.do_not_optimize(%c63) : index
%2 = util.do_not_optimize(%c511) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_127x63_times_identity_63x511_plus_zero_accumulator() {
%c127 = constant 127 : index
%c63 = constant 63 : index
%c511 = constant 511 : index
%c765010652_i32 = constant 765010652 : i32
%0 = util.do_not_optimize(%c127) : index
%1 = util.do_not_optimize(%c63) : index
%2 = util.do_not_optimize(%c511) : index
%3 = call @random_matrix(%0, %1, %c765010652_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_127x63_times_random_63x511_plus_zero_accumulator() {
%c127 = constant 127 : index
%c63 = constant 63 : index
%c511 = constant 511 : index
%c1847872527_i32 = constant 1847872527 : i32
%0 = util.do_not_optimize(%c127) : index
%1 = util.do_not_optimize(%c63) : index
%2 = util.do_not_optimize(%c511) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1847872527_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_127x63_times_identity_63x511_plus_random_accumulator() {
%c127 = constant 127 : index
%c63 = constant 63 : index
%c511 = constant 511 : index
%c773989025_i32 = constant 773989025 : i32
%0 = util.do_not_optimize(%c127) : index
%1 = util.do_not_optimize(%c63) : index
%2 = util.do_not_optimize(%c511) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c773989025_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_127x63_times_random_63x511_plus_random_accumulator() {
%c127 = constant 127 : index
%c63 = constant 63 : index
%c511 = constant 511 : index
%c1451218916_i32 = constant 1451218916 : i32
%c871729096_i32 = constant 871729096 : i32
%c1440613698_i32 = constant 1440613698 : i32
%0 = util.do_not_optimize(%c127) : index
%1 = util.do_not_optimize(%c63) : index
%2 = util.do_not_optimize(%c511) : index
%3 = call @random_matrix(%0, %1, %c1451218916_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c871729096_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1440613698_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_127x63_times_random_63x511_plus_random_accumulator() {
%c127 = constant 127 : index
%c63 = constant 63 : index
%c511 = constant 511 : index
%c48359004_i32 = constant 48359004 : i32
%c22757795_i32 = constant 22757795 : i32
%c1177378828_i32 = constant 1177378828 : i32
%0 = util.do_not_optimize(%c127) : index
%1 = util.do_not_optimize(%c63) : index
%2 = util.do_not_optimize(%c511) : index
%3 = call @random_matrix(%0, %1, %c48359004_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c22757795_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1177378828_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<127x63xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<63x511xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<127x511xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<127x63xf32>, tensor<63x511xf32>) outs(%8 : tensor<127x511xf32>) -> tensor<127x511xf32>
%10 = tensor.cast %9 : tensor<127x511xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_127x63_times_random_63x511_plus_random_accumulator() {
%c127 = constant 127 : index
%c63 = constant 63 : index
%c511 = constant 511 : index
%c98688533_i32 = constant 98688533 : i32
%c675447397_i32 = constant 675447397 : i32
%c1424571833_i32 = constant 1424571833 : i32
%0 = util.do_not_optimize(%c127) : index
%1 = util.do_not_optimize(%c63) : index
%2 = util.do_not_optimize(%c511) : index
%3 = call @random_matrix(%0, %1, %c98688533_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c675447397_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1424571833_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<?x63xf32>
%7 = tensor.cast %5 : tensor<?x?xf32> to tensor<127x511xf32>
%8 = linalg.matmul ins(%6, %4 : tensor<?x63xf32>, tensor<?x?xf32>) outs(%7 : tensor<127x511xf32>) -> tensor<127x511xf32>
%9 = tensor.cast %8 : tensor<127x511xf32> to tensor<?x?xf32>
%10 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%9, %10) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1023x127_times_identity_127x31_plus_zero_accumulator() {
%c1023 = constant 1023 : index
%c127 = constant 127 : index
%c31 = constant 31 : index
%0 = util.do_not_optimize(%c1023) : index
%1 = util.do_not_optimize(%c127) : index
%2 = util.do_not_optimize(%c31) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1023x127_times_identity_127x31_plus_zero_accumulator() {
%c1023 = constant 1023 : index
%c127 = constant 127 : index
%c31 = constant 31 : index
%c1685657822_i32 = constant 1685657822 : i32
%0 = util.do_not_optimize(%c1023) : index
%1 = util.do_not_optimize(%c127) : index
%2 = util.do_not_optimize(%c31) : index
%3 = call @random_matrix(%0, %1, %c1685657822_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1023x127_times_random_127x31_plus_zero_accumulator() {
%c1023 = constant 1023 : index
%c127 = constant 127 : index
%c31 = constant 31 : index
%c233340932_i32 = constant 233340932 : i32
%0 = util.do_not_optimize(%c1023) : index
%1 = util.do_not_optimize(%c127) : index
%2 = util.do_not_optimize(%c31) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c233340932_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1023x127_times_identity_127x31_plus_random_accumulator() {
%c1023 = constant 1023 : index
%c127 = constant 127 : index
%c31 = constant 31 : index
%c48400057_i32 = constant 48400057 : i32
%0 = util.do_not_optimize(%c1023) : index
%1 = util.do_not_optimize(%c127) : index
%2 = util.do_not_optimize(%c31) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c48400057_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1023x127_times_random_127x31_plus_random_accumulator() {
%c1023 = constant 1023 : index
%c127 = constant 127 : index
%c31 = constant 31 : index
%c2004427158_i32 = constant 2004427158 : i32
%c827628233_i32 = constant 827628233 : i32
%c804150002_i32 = constant 804150002 : i32
%0 = util.do_not_optimize(%c1023) : index
%1 = util.do_not_optimize(%c127) : index
%2 = util.do_not_optimize(%c31) : index
%3 = call @random_matrix(%0, %1, %c2004427158_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c827628233_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c804150002_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1023x127_times_random_127x31_plus_random_accumulator() {
%c1023 = constant 1023 : index
%c127 = constant 127 : index
%c31 = constant 31 : index
%c1357827017_i32 = constant 1357827017 : i32
%c319547520_i32 = constant 319547520 : i32
%c1650785166_i32 = constant 1650785166 : i32
%0 = util.do_not_optimize(%c1023) : index
%1 = util.do_not_optimize(%c127) : index
%2 = util.do_not_optimize(%c31) : index
%3 = call @random_matrix(%0, %1, %c1357827017_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c319547520_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1650785166_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1023x127xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<127x31xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1023x31xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1023x127xf32>, tensor<127x31xf32>) outs(%8 : tensor<1023x31xf32>) -> tensor<1023x31xf32>
%10 = tensor.cast %9 : tensor<1023x31xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1023x127_times_random_127x31_plus_random_accumulator() {
%c1023 = constant 1023 : index
%c127 = constant 127 : index
%c31 = constant 31 : index
%c522542404_i32 = constant 522542404 : i32
%c1448949469_i32 = constant 1448949469 : i32
%c844918956_i32 = constant 844918956 : i32
%0 = util.do_not_optimize(%c1023) : index
%1 = util.do_not_optimize(%c127) : index
%2 = util.do_not_optimize(%c31) : index
%3 = call @random_matrix(%0, %1, %c522542404_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1448949469_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c844918956_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %5 : tensor<?x?xf32> to tensor<?x31xf32>
%7 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%6 : tensor<?x31xf32>) -> tensor<?x31xf32>
%8 = tensor.cast %7 : tensor<?x31xf32> to tensor<?x?xf32>
%9 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%8, %9) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_129x65_times_identity_65x512_plus_zero_accumulator() {
%c129 = constant 129 : index
%c65 = constant 65 : index
%c512 = constant 512 : index
%0 = util.do_not_optimize(%c129) : index
%1 = util.do_not_optimize(%c65) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_129x65_times_identity_65x512_plus_zero_accumulator() {
%c129 = constant 129 : index
%c65 = constant 65 : index
%c512 = constant 512 : index
%c1547954671_i32 = constant 1547954671 : i32
%0 = util.do_not_optimize(%c129) : index
%1 = util.do_not_optimize(%c65) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @random_matrix(%0, %1, %c1547954671_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_129x65_times_random_65x512_plus_zero_accumulator() {
%c129 = constant 129 : index
%c65 = constant 65 : index
%c512 = constant 512 : index
%c1773910123_i32 = constant 1773910123 : i32
%0 = util.do_not_optimize(%c129) : index
%1 = util.do_not_optimize(%c65) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1773910123_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_129x65_times_identity_65x512_plus_random_accumulator() {
%c129 = constant 129 : index
%c65 = constant 65 : index
%c512 = constant 512 : index
%c1800090502_i32 = constant 1800090502 : i32
%0 = util.do_not_optimize(%c129) : index
%1 = util.do_not_optimize(%c65) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1800090502_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_129x65_times_random_65x512_plus_random_accumulator() {
%c129 = constant 129 : index
%c65 = constant 65 : index
%c512 = constant 512 : index
%c685297128_i32 = constant 685297128 : i32
%c139567300_i32 = constant 139567300 : i32
%c396937661_i32 = constant 396937661 : i32
%0 = util.do_not_optimize(%c129) : index
%1 = util.do_not_optimize(%c65) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @random_matrix(%0, %1, %c685297128_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c139567300_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c396937661_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_129x65_times_random_65x512_plus_random_accumulator() {
%c129 = constant 129 : index
%c65 = constant 65 : index
%c512 = constant 512 : index
%c728735597_i32 = constant 728735597 : i32
%c1013864927_i32 = constant 1013864927 : i32
%c1269059734_i32 = constant 1269059734 : i32
%0 = util.do_not_optimize(%c129) : index
%1 = util.do_not_optimize(%c65) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @random_matrix(%0, %1, %c728735597_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1013864927_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1269059734_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<129x65xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<65x512xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<129x512xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<129x65xf32>, tensor<65x512xf32>) outs(%8 : tensor<129x512xf32>) -> tensor<129x512xf32>
%10 = tensor.cast %9 : tensor<129x512xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_129x65_times_random_65x512_plus_random_accumulator() {
%c129 = constant 129 : index
%c65 = constant 65 : index
%c512 = constant 512 : index
%c1811389239_i32 = constant 1811389239 : i32
%c625784517_i32 = constant 625784517 : i32
%c739441405_i32 = constant 739441405 : i32
%0 = util.do_not_optimize(%c129) : index
%1 = util.do_not_optimize(%c65) : index
%2 = util.do_not_optimize(%c512) : index
%3 = call @random_matrix(%0, %1, %c1811389239_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c625784517_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c739441405_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<?x65xf32>
%7 = linalg.matmul ins(%6, %4 : tensor<?x65xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%8 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%7, %8) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1025x129_times_identity_129x33_plus_zero_accumulator() {
%c1025 = constant 1025 : index
%c129 = constant 129 : index
%c33 = constant 33 : index
%0 = util.do_not_optimize(%c1025) : index
%1 = util.do_not_optimize(%c129) : index
%2 = util.do_not_optimize(%c33) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1025x129_times_identity_129x33_plus_zero_accumulator() {
%c1025 = constant 1025 : index
%c129 = constant 129 : index
%c33 = constant 33 : index
%c2068951643_i32 = constant 2068951643 : i32
%0 = util.do_not_optimize(%c1025) : index
%1 = util.do_not_optimize(%c129) : index
%2 = util.do_not_optimize(%c33) : index
%3 = call @random_matrix(%0, %1, %c2068951643_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1025x129_times_random_129x33_plus_zero_accumulator() {
%c1025 = constant 1025 : index
%c129 = constant 129 : index
%c33 = constant 33 : index
%c1637755518_i32 = constant 1637755518 : i32
%0 = util.do_not_optimize(%c1025) : index
%1 = util.do_not_optimize(%c129) : index
%2 = util.do_not_optimize(%c33) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1637755518_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @zero_accumulator_matrix(%0, %2) : (index, index) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_identity_1025x129_times_identity_129x33_plus_random_accumulator() {
%c1025 = constant 1025 : index
%c129 = constant 129 : index
%c33 = constant 33 : index
%c781112367_i32 = constant 781112367 : i32
%0 = util.do_not_optimize(%c1025) : index
%1 = util.do_not_optimize(%c129) : index
%2 = util.do_not_optimize(%c33) : index
%3 = call @identity_matrix(%0, %1) : (index, index) -> tensor<?x?xf32>
%4 = call @identity_matrix(%1, %2) : (index, index) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c781112367_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @dynamic_shapes_random_1025x129_times_random_129x33_plus_random_accumulator() {
%c1025 = constant 1025 : index
%c129 = constant 129 : index
%c33 = constant 33 : index
%c1704677078_i32 = constant 1704677078 : i32
%c1336330039_i32 = constant 1336330039 : i32
%c2021007630_i32 = constant 2021007630 : i32
%0 = util.do_not_optimize(%c1025) : index
%1 = util.do_not_optimize(%c129) : index
%2 = util.do_not_optimize(%c33) : index
%3 = call @random_matrix(%0, %1, %c1704677078_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1336330039_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c2021007630_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = linalg.matmul ins(%3, %4 : tensor<?x?xf32>, tensor<?x?xf32>) outs(%5 : tensor<?x?xf32>) -> tensor<?x?xf32>
%7 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%6, %7) : tensor<?x?xf32>
return
}
func @static_shapes_random_1025x129_times_random_129x33_plus_random_accumulator() {
%c1025 = constant 1025 : index
%c129 = constant 129 : index
%c33 = constant 33 : index
%c172191814_i32 = constant 172191814 : i32
%c1109339704_i32 = constant 1109339704 : i32
%c1432113839_i32 = constant 1432113839 : i32
%0 = util.do_not_optimize(%c1025) : index
%1 = util.do_not_optimize(%c129) : index
%2 = util.do_not_optimize(%c33) : index
%3 = call @random_matrix(%0, %1, %c172191814_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c1109339704_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c1432113839_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1025x129xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<129x33xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1025x33xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1025x129xf32>, tensor<129x33xf32>) outs(%8 : tensor<1025x33xf32>) -> tensor<1025x33xf32>
%10 = tensor.cast %9 : tensor<1025x33xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
func @mixed_shapes_random_1025x129_times_random_129x33_plus_random_accumulator() {
%c1025 = constant 1025 : index
%c129 = constant 129 : index
%c33 = constant 33 : index
%c2068525439_i32 = constant 2068525439 : i32
%c391815057_i32 = constant 391815057 : i32
%c416137318_i32 = constant 416137318 : i32
%0 = util.do_not_optimize(%c1025) : index
%1 = util.do_not_optimize(%c129) : index
%2 = util.do_not_optimize(%c33) : index
%3 = call @random_matrix(%0, %1, %c2068525439_i32) : (index, index, i32) -> tensor<?x?xf32>
%4 = call @random_matrix(%1, %2, %c391815057_i32) : (index, index, i32) -> tensor<?x?xf32>
%5 = call @random_accumulator_matrix(%0, %2, %c416137318_i32) : (index, index, i32) -> tensor<?x?xf32>
%6 = tensor.cast %3 : tensor<?x?xf32> to tensor<1025x?xf32>
%7 = tensor.cast %4 : tensor<?x?xf32> to tensor<?x33xf32>
%8 = tensor.cast %5 : tensor<?x?xf32> to tensor<1025x33xf32>
%9 = linalg.matmul ins(%6, %7 : tensor<1025x?xf32>, tensor<?x33xf32>) outs(%8 : tensor<1025x33xf32>) -> tensor<1025x33xf32>
%10 = tensor.cast %9 : tensor<1025x33xf32> to tensor<?x?xf32>
%11 = call @reference_matmul(%3, %4, %5) : (tensor<?x?xf32>, tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
check.expect_almost_eq(%10, %11) : tensor<?x?xf32>
return
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment