Skip to content

Commit 985f13d

Browse files
author
Nathanael See
committed
[BE][ET-VK] update clone to use layout gen
TSIA pytorchbot label "topic: not user facing" Differential Revision: [D71825480](https://our.internmc.facebook.com/intern/diff/D71825480/) ghstack-source-id: 273955839 Pull Request resolved: #9589
1 parent 8e5a44d commit 985f13d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@
1212

1313
layout(std430) buffer;
1414

15-
layout(set = 0, binding = 0, ${IMAGE_FORMAT[DTYPE]}) uniform PRECISION restrict writeonly ${IMAGE_T[NDIM][DTYPE]} image_out;
16-
layout(set = 0, binding = 1) uniform PRECISION sampler3D image_in;
17-
18-
layout(set = 0, binding = 2) uniform PRECISION restrict OutLimits {
19-
ivec3 out_limits;
20-
};
15+
${layout_declare_tensor(B, "w", "t_out", DTYPE, STORAGE)}
16+
${layout_declare_tensor(B, "r", "t_in", DTYPE, STORAGE)}
17+
${layout_declare_ubo(B, "ivec3", "out_limits")}
2118

2219
layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
2320

@@ -26,5 +23,5 @@ void main() {
2623
if (any(greaterThanEqual(pos, out_limits))) {
2724
return;
2825
}
29-
imageStore(image_out, pos, texelFetch(image_in, pos, 0));
26+
imageStore(t_out, pos, load_texel(t_in, pos));
3027
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ clone:
22
parameter_names_with_default_values:
33
DTYPE: float
44
NDIM: 3
5+
STORAGE: texture3d
56
generate_variant_forall:
67
DTYPE:
78
- VALUE: half

0 commit comments

Comments
 (0)