Skip to content

Commit 1fa557d

Browse files
committed
Update base for Update on "[ET-VK] Introduce generalized shaders for transfer ops and use it for select and slice"
## Changes * Introduce `transfer_buffer.glsl` and `transfer_texture.glsl`, and `Transfer.cpp` which generalizes shaders where each element of the output is copied from a unique element of the input. * Update `Slice.cpp` and `Select.cpp` to use `Transfer.cpp` * Remove old implementations of slice and select ## Motivation With this new implementation, the op can now support both buffers and textures of any packing. There are also benefits of code consolidation. Differential Revision: [D75686050](https://our.internmc.facebook.com/intern/diff/D75686050/) [ghstack-poisoned]
1 parent 5c85631 commit 1fa557d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

backends/vulkan/runtime/VulkanBackend.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,10 @@ class VulkanBackend final : public ::executorch::runtime::BackendInterface {
499499
compute_graph->encode_prepack();
500500
compute_graph->prepack();
501501

502+
// TODO(ssjia): remove this once we can batch compile compute pipelines
503+
// during prepare().
504+
compute_graph->encode_execute();
505+
502506
return Error::Ok;
503507
}
504508

@@ -572,12 +576,7 @@ class VulkanBackend final : public ::executorch::runtime::BackendInterface {
572576
if (should_propagate_resize) {
573577
compute_graph->propagate_resize();
574578
}
575-
// If propagate_resize() was not triggered (i.e. command buffer has not been
576-
// encoded), then make sure to encode the command buffer before executing
577-
// the first inference of the model.
578-
else if (compute_graph->execute_count() == 0) {
579-
compute_graph->encode_execute();
580-
}
579+
581580
compute_graph->execute();
582581

583582
for (size_t i = 0; i < compute_graph->outputs().size(); i++) {

0 commit comments

Comments
 (0)