2020-09-17 08:31:40 +08:00
|
|
|
// RUN: npcomp-opt <%s | npcomp-opt | FileCheck %s --dump-input=fail
|
2020-05-07 09:41:54 +08:00
|
|
|
|
2020-07-11 08:31:24 +08:00
|
|
|
// CHECK-LABEL: tcp.global @foo dense<0.0{{.*}}> : tensor<10xf32>
|
|
|
|
tcp.global @foo dense<0.0> : tensor<10xf32>
|
|
|
|
|
2020-05-07 09:41:54 +08:00
|
|
|
func @f(%arg0: tensor<?xf32>, %arg1: tensor<?xf32>, %arg2: i32) {
|
|
|
|
// CHECK: tcp.add
|
2020-05-15 06:19:37 +08:00
|
|
|
%0 = "tcp.add"(%arg0, %arg1) : (tensor<?xf32>, tensor<?xf32>) -> tensor<?xf32>
|
2020-07-11 08:31:24 +08:00
|
|
|
%1 = tcp.get_global_memref @foo : memref<10xf32>
|
2020-05-07 09:41:54 +08:00
|
|
|
return
|
2020-05-15 06:19:37 +08:00
|
|
|
}
|
2020-09-17 08:31:40 +08:00
|
|
|
|
|
|
|
// CHECK-LABEL: func @g
|
|
|
|
// CHECK-NEXT: %[[RET:.*]] = tcp.shaped_results %arg1 {
|
|
|
|
// CHECK-NEXT: %[[VAL:.*]] =
|
|
|
|
// CHECK-NEXT: tcp.yield %[[VAL]] : tensor<?x?xf32>
|
|
|
|
// CHECK-NEXT: } : tensor<?xindex> -> tensor<?x?xf32>
|
|
|
|
// CHECK-NEXT: return %[[RET]] : tensor<?x?xf32>
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
func @g(%arg0: tensor<?x?xf32>, %arg1: tensor<?xindex>) -> tensor<?x?xf32> {
|
|
|
|
%add = tcp.shaped_results %arg1 {
|
|
|
|
%0 = "tcp.add"(%arg0, %arg0) : (tensor<?x?xf32>, tensor<?x?xf32>) -> tensor<?x?xf32>
|
|
|
|
tcp.yield %0 : tensor<?x?xf32>
|
|
|
|
} : tensor<?xindex> -> tensor<?x?xf32>
|
|
|
|
return %add : tensor<?x?xf32>
|
|
|
|
}
|