Skip to content

Commit b5793ab

Browse files
trivedivivekfacebook-github-bot
authored andcommitted
Using push constants for clone op parameters. (#16113)
Summary: This diff modifies the clone operation in the Executorch Vulkan backend to use push constants instead of a uniform buffer for storing the output limits. Reviewed By: yipjustin Differential Revision: D88097604
1 parent 7e1fefa commit b5793ab

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ layout(std430) buffer;
1616

1717
${layout_declare_tensor(B, "w", "t_out", DTYPE, STORAGE)}
1818
${layout_declare_tensor(B, "r", "t_in", DTYPE, STORAGE)}
19-
${layout_declare_ubo(B, "ivec3", "out_limits")}
19+
20+
layout(push_constant) uniform restrict Block {
21+
ivec3 out_limits;
22+
};
2023

2124
layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
2225

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ void add_clone_node(
4848
// Inputs and Outputs
4949
{{out, vkapi::kWrite}, {in, vkapi::kRead}},
5050
// Parameter Buffers
51-
{graph.logical_limits_ubo(out)},
52-
// Push Constants
5351
{},
52+
// Push Constants
53+
{graph.logical_limits_pc_of(out)},
5454
// Specialization Constants
5555
{},
5656
// Resize Args

0 commit comments

Comments
 (0)