@@ -57,13 +57,13 @@ TEST(NanoIfrtClientTest, BigResult) {
57
57
// A program that is likely to need some temporary buffers to be allocated.
58
58
absl::string_view kBigResult =
59
59
R"( module {
60
- func.func @main(%arg : tensor<f32>) -> tensor<1024x1024xf32> {
61
- %0 = "mhlo .broadcast"(%arg) {broadcast_sizes = dense< [1024, 1024]> : tensor<2xi64>} : (tensor<f32>) -> tensor<1024x1024xf32>
62
- %1 = "mhlo .add"( %0, %0) : (tensor<1024x1024xf32>, tensor<1024x1024xf32>) -> tensor<1024x1024xf32>
63
- %2 = "mhlo .dot"( %1, %1) : (tensor<1024x1024xf32>, tensor<1024x1024xf32>) -> tensor<1024x1024xf32>
64
- return %2 : tensor<1024x1024xf32>
65
- }
66
- })" ;
60
+ func.func @main(%arg0 : tensor<f32>) -> tensor<1024x1024xf32> {
61
+ %0 = stablehlo .broadcast %arg0, sizes = [1024, 1024] : (tensor<f32>) -> tensor<1024x1024xf32>
62
+ %1 = stablehlo .add %0, %0 : tensor<1024x1024xf32>
63
+ %2 = stablehlo .dot %1, %1 : (tensor<1024x1024xf32>, tensor<1024x1024xf32>) -> tensor<1024x1024xf32>
64
+ return %2 : tensor<1024x1024xf32>
65
+ }
66
+ })" ;
67
67
auto client = NanoIfrtClient::Create ();
68
68
auto compiler = client->GetDefaultCompiler ();
69
69
@@ -142,7 +142,7 @@ static void BM_IfRtAddScalars(benchmark::State& state) {
142
142
constexpr absl::string_view program =
143
143
R"( module {
144
144
func.func @main(%arg0: tensor<f32>, %arg1: tensor<f32>) -> tensor<f32> {
145
- %0 = mhlo .add %arg0, %arg1 : tensor<f32>
145
+ %0 = stablehlo .add %arg0, %arg1 : tensor<f32>
146
146
return %0 : tensor<f32>
147
147
}
148
148
})" ;
@@ -185,16 +185,16 @@ static void BM_IfRtAddManyScalars(benchmark::State& state) {
185
185
-> (tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>,
186
186
tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>)
187
187
{
188
- %0 = mhlo .add %arg0, %arg1 : tensor<f32>
189
- %1 = mhlo .add %arg0, %0 : tensor<f32>
190
- %2 = mhlo .add %arg0, %1 : tensor<f32>
191
- %3 = mhlo .add %arg0, %2 : tensor<f32>
192
- %4 = mhlo .add %arg0, %3 : tensor<f32>
193
- %5 = mhlo .add %arg0, %4 : tensor<f32>
194
- %6 = mhlo .add %arg0, %5 : tensor<f32>
195
- %7 = mhlo .add %arg0, %6 : tensor<f32>
196
- %8 = mhlo .add %arg0, %7 : tensor<f32>
197
- %9 = mhlo .add %arg0, %8 : tensor<f32>
188
+ %0 = stablehlo .add %arg0, %arg1 : tensor<f32>
189
+ %1 = stablehlo .add %arg0, %0 : tensor<f32>
190
+ %2 = stablehlo .add %arg0, %1 : tensor<f32>
191
+ %3 = stablehlo .add %arg0, %2 : tensor<f32>
192
+ %4 = stablehlo .add %arg0, %3 : tensor<f32>
193
+ %5 = stablehlo .add %arg0, %4 : tensor<f32>
194
+ %6 = stablehlo .add %arg0, %5 : tensor<f32>
195
+ %7 = stablehlo .add %arg0, %6 : tensor<f32>
196
+ %8 = stablehlo .add %arg0, %7 : tensor<f32>
197
+ %9 = stablehlo .add %arg0, %8 : tensor<f32>
198
198
return %0, %1, %2, %3, %4, %5, %6, %7, %8, %9
199
199
: tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>,
200
200
tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>, tensor<f32>
0 commit comments