@@ -434,117 +434,6 @@ func.func @generalize_const(%min: f64, %max: f64, %seed: i32, %O: tensor<16x32xf
434434
435435// -----
436436
437- // Verifies the default value of the fun attribute is an exp op.
438- func.func @generalize_elemwise_exp (%lhs : tensor <4 x8 xf32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
439- %0 = linalg.elemwise_unary ins (%lhs: tensor <4 x8 xf32 >) outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
440- return %0: tensor <4 x8 xf32 >
441- }
442-
443- // CHECK-LABEL: @generalize_elemwise_exp
444- // CHECK: = math.exp
445-
446- // -----
447-
448- // Verifies the fun attribute controls the unary function used.
449- func.func @generalize_elemwise_log (%lhs : tensor <4 x8 xf32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
450- %0 = linalg.elemwise_unary {fun = #linalg.unary_fn <log >}
451- ins (%lhs: tensor <4 x8 xf32 >) outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
452- return %0: tensor <4 x8 xf32 >
453- }
454-
455- // CHECK-LABEL: @generalize_elemwise_log
456- // CHECK: = math.log
457-
458- // -----
459-
460- // Verifies the fun attribute controls the unary function used.
461- func.func @generalize_elemwise_abs (%lhs : tensor <4 x8 xf32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
462- %0 = linalg.elemwise_unary {fun = #linalg.unary_fn <abs >}
463- ins (%lhs: tensor <4 x8 xf32 >) outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
464- return %0: tensor <4 x8 xf32 >
465- }
466-
467- // CHECK-LABEL: @generalize_elemwise_abs
468- // CHECK: = math.absf
469-
470- // -----
471-
472- // Verifies the fun attribute controls the unary function used.
473- func.func @generalize_elemwise_ceil (%lhs : tensor <4 x8 xf32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
474- %0 = linalg.elemwise_unary {fun = #linalg.unary_fn <ceil >}
475- ins (%lhs: tensor <4 x8 xf32 >) outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
476- return %0: tensor <4 x8 xf32 >
477- }
478-
479- // CHECK-LABEL: @generalize_elemwise_ceil
480- // CHECK: = math.ceil
481-
482- // -----
483-
484- // Verifies the fun attribute controls the unary function used.
485- func.func @generalize_elemwise_floor (%lhs : tensor <4 x8 xf32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
486- %0 = linalg.elemwise_unary {fun = #linalg.unary_fn <floor >}
487- ins (%lhs: tensor <4 x8 xf32 >) outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
488- return %0: tensor <4 x8 xf32 >
489- }
490-
491- // CHECK-LABEL: @generalize_elemwise_floor
492- // CHECK: = math.floor
493-
494- // -----
495-
496- // Verifies the fun attribute controls the unary function used.
497- func.func @generalize_elemwise_negf (%lhs : tensor <4 x8 xf32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
498- %0 = linalg.elemwise_unary {fun = #linalg.unary_fn <negf >}
499- ins (%lhs: tensor <4 x8 xf32 >) outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
500- return %0: tensor <4 x8 xf32 >
501- }
502-
503- // CHECK-LABEL: @generalize_elemwise_negf
504- // CHECK: = arith.negf
505-
506- // -----
507-
508- // Verifies the default value of the fun attribute is an add op.
509- func.func @generalize_elemwise_add (%lhs : tensor <4 x8 xf32 >, %rhs : tensor <4 x8 xf32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
510- %0 = linalg.elemwise_binary ins (%lhs , %rhs: tensor <4 x8 xf32 >, tensor <4 x8 xf32 >)
511- outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
512- return %0: tensor <4 x8 xf32 >
513- }
514-
515- // CHECK-LABEL: @generalize_elemwise_add
516- // CHECK: = arith.addf
517-
518- // -----
519-
520- // Verifies the fun attribute controls the binary function used.
521- func.func @generalize_elemwise_mul (%lhs : tensor <4 x8 xf32 >, %rhs : tensor <4 x8 xf32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
522- %0 = linalg.elemwise_binary {fun = #linalg.binary_fn <mul >}
523- ins (%lhs , %rhs: tensor <4 x8 xf32 >, tensor <4 x8 xf32 >)
524- outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
525- return %0: tensor <4 x8 xf32 >
526- }
527-
528- // CHECK-LABEL: @generalize_elemwise_mul
529- // CHECK: = arith.mulf
530-
531- // -----
532-
533- // Verifies pointwise ops support rank zero input tensors
534- func.func @generalize_elemwise_rank_zero (%lhs : tensor <f32 >, %rhs : tensor <f32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
535- %0 = linalg.elemwise_binary {fun = #linalg.binary_fn <sub >}
536- ins (%lhs , %rhs: tensor <f32 >, tensor <f32 >)
537- outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
538- return %0: tensor <4 x8 xf32 >
539- }
540-
541- // CHECK-LABEL: @generalize_elemwise_rank_zero
542- // CHECK: linalg.generic
543- // CHECK-SAME: iterator_types = ["parallel", "parallel"]
544- // CHECK: = arith.subf
545-
546- // -----
547-
548437// Verifies the fun attribute controls the binary function used.
549438func.func @generalize_copy (%lhs : tensor <4 x8 xf32 >, %output : tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 > {
550439 %0 = linalg.copy ins (%lhs: tensor <4 x8 xf32 >) outs (%output: tensor <4 x8 xf32 >) -> tensor <4 x8 xf32 >
0 commit comments