Skip to content

Commit abb2b29

Browse files
committed
Add tests for mesh.process_linear_index
1 parent 967abe1 commit abb2b29

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

mlir/test/Dialect/Mesh/invalid.mlir

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,15 @@ func.func @process_multi_index_wrong_number_of_results_empty_mesh_axes() -> (ind
169169
func.func @process_multi_index_invalid_mesh_name() -> (index) {
170170
// expected-error@+1 {{Undefined required mesh symbol "this_mesh_symbol_does_not_exist".}}
171171
%0 = mesh.process_multi_index on @this_mesh_symbol_does_not_exist : index
172-
return %0#0 : index
172+
return %0 : index
173+
}
174+
175+
// -----
176+
177+
func.func @process_linear_index_invalid_mesh_name() -> (index) {
178+
// expected-error@+1 {{Undefined required mesh symbol "this_mesh_symbol_does_not_exist".}}
179+
%0 = mesh.process_linear_index on @this_mesh_symbol_does_not_exist : index
180+
return %0 : index
173181
}
174182

175183
// -----

mlir/test/Dialect/Mesh/ops.mlir

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,13 @@ func.func @process_multi_index_empty_axes() -> (index, index, index) {
180180
return %0#0, %0#1, %0#2 : index, index, index
181181
}
182182

183+
// CHECK-LABEL: func @process_linear_index
184+
func.func @process_linear_index() -> index {
185+
// CHECK: %[[RES:.*]] = mesh.process_linear_index on @mesh0 : index
186+
%0 = mesh.process_linear_index on @mesh0 : index
187+
// CHECK: return %[[RES]] : index
188+
return %0 : index
189+
}
183190

184191
// CHECK-LABEL: func @all_reduce
185192
func.func @all_reduce(

0 commit comments

Comments
 (0)