Skip to content

Commit b48e4d9

Browse files
committed
Update base for Update on "[11/n][ET-VK] Introduce vTensor creation from external image"
Nearly all metadata is initialized to null/dummy values, except those absolutely needed in the pipeline: (1) image extents, (2) logical limits. Differential Revision: [D63843819](https://our.internmc.facebook.com/intern/diff/D63843819/) [ghstack-poisoned]
2 parents 835dc17 + c35fb94 commit b48e4d9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ void add_staging_to_tensor_node(
5151
{}));
5252
}
5353

54+
const std::string kBitw8PrefixStr = "bitw8_image_to_nchw_nobitw8buffer";
55+
56+
bool is_bitw8_shader(const vkapi::ShaderInfo& shader) {
57+
const auto size = shader.kernel_name.size();
58+
const std::string& shader_prefix_str = shader.kernel_name.substr(0, size);
59+
return shader_prefix_str == kBitw8PrefixStr;
60+
}
61+
5462
void add_tensor_to_staging_node(
5563
ComputeGraph& graph,
5664
const ValueRef in_tensor,
@@ -80,7 +88,7 @@ void add_tensor_to_staging_node(
8088
// output buffer. Therefore, the global work group size for this shader will
8189
// be the number of elements in the output buffer divided by 4, as opposed to
8290
// the extents of the input texture.
83-
if (shader.kernel_name.starts_with("bitw8_image_to_nchw_nobitw8buffer")) {
91+
if (is_bitw8_shader(shader)) {
8492
uint32_t buffer_len = graph.get_staging(out_staging)->numel() / 4;
8593
global_wg_size = {buffer_len, 1, 1};
8694
ubos.append({graph.numel_ubo(in_tensor)});

0 commit comments

Comments
 (0)