Skip to content

Migrate upsample op to new layout declare using the gen_vulkan_spv.py #3730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions backends/vulkan/runtime/graph/ops/glsl/upsample.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,15 @@

#define PRECISION ${PRECISION}

#define VEC4_T ${texel_type(DTYPE)}
#define VEC4_T ${texel_load_type(DTYPE, STORAGE)}
${define_active_storage_type(STORAGE)}

layout(std430) buffer;

layout(set = 0, binding = 0, ${IMAGE_FORMAT[DTYPE]}) uniform PRECISION restrict writeonly ${IMAGE_T[NDIM][DTYPE]} image_out;

layout(set = 0, binding = 1) uniform PRECISION sampler3D image_in;

layout(set = 0, binding = 2) uniform PRECISION restrict OutLimits {
ivec3 out_limits;
};

layout(set = 0, binding = 3) uniform PRECISION restrict Sizes {
ivec4 sizes;
};
${layout_declare_tensor(0, "w", "image_out", DTYPE, STORAGE)}
${layout_declare_tensor(1, "r", "image_in", DTYPE, STORAGE)}
${layout_declare_ubo(2, "ivec3", "out_limits")}
${layout_declare_ubo(3, "ivec4", "sizes")}

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

Expand Down
1 change: 1 addition & 0 deletions backends/vulkan/runtime/graph/ops/glsl/upsample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ upsample:
NDIM: 3
DTYPE: float
PACKING: C_packed
STORAGE: texture3d
generate_variant_forall:
DTYPE:
- VALUE: half
Expand Down
Loading