Skip to content

Commit a164c58

Browse files
committed
Update on "[ET-VK] Adding all tensor packing support for repeat op."
This diff updates Executorch Vulkan backend's `repeat` operation to support width, height and channel packed tensors. It also updates the op_registry.py file to indicate `repeat` operation supports all packing. Differential Revision: [D71477633](https://our.internmc.facebook.com/intern/diff/D71477633/) [ghstack-poisoned]
2 parents a405c64 + f0d1a23 commit a164c58

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

backends/vulkan/runtime/graph/ops/glsl/copy_packed_dim_offset.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const lowp int packed_dim = unhash_packed_dim(out_layout);
4545
${layout_declare_spec_const(C, "int", "in_layout", "DEFAULT_LAYOUT")}
4646
const lowp ivec4 in_axis_map = unhash_axis_map(in_layout);
4747

48-
${layout_declare_spec_const(C, "bool", "repeat", "false")}
48+
${layout_declare_spec_const(C, "int", "repeat", "0")}
4949

5050
void no_repeat_copy(ivec3 pos) {
5151
// Position in input tensor
@@ -229,7 +229,7 @@ void main() {
229229
return;
230230
}
231231

232-
if (repeat) {
232+
if (repeat == 1) {
233233
repeat_copy(pos);
234234
} else {
235235
no_repeat_copy(pos);

backends/vulkan/runtime/graph/ops/impl/Copy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void add_copy_packed_dim_offset_node(
151151
// Parameter buffers
152152
{},
153153
// Specialization Constants
154-
{graph.hashed_layout_of(out), graph.hashed_layout_of(in), repeat},
154+
{graph.hashed_layout_of(out), graph.hashed_layout_of(in), repeat ? 1 : 0},
155155
nullptr,
156156
{},
157157
{

0 commit comments

Comments
 (0)