Skip to content

Commit 563c3b1

Browse files
committed
Update on "[ET-VK] Adding a common utility function to calculate 3d output position based on unique index."
This diff adds an indexing utils header file used in Vulkan backend of Executorch. The header file includes functions for converting a global index to u16 indices based on input sizes. Differential Revision: [D67821941](https://our.internmc.facebook.com/intern/diff/D67821941/) [ghstack-poisoned]
1 parent a93a2f2 commit 563c3b1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

backends/vulkan/runtime/graph/ops/glsl/indexing_utils_u16.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313

1414
u16vec3 idx_to_u16pos_x_wise(uint idx, int size_x, int size_y) {
1515
const uint div_by_x = idx / size_x;
16-
return u16vec3(
17-
idx % size_x,
18-
div_by_x % size_y,
19-
div_by_x / size_y);
16+
return u16vec3(idx % size_x, div_by_x % size_y, div_by_x / size_y);
2017
}
2118

2219
#endif // INDEXING_UTILS_U16_H

0 commit comments

Comments
 (0)