Skip to content

Commit 5a4de9d

Browse files
committed
Update on "[ET-VK] Replace Uniform buffers with push constants for permute op"
This diff replaces uniform buffers with push constants for permute op in the Vulkan backend of Executorch. The changes include updating the GLSL code to use push constants instead of uniform buffers and updating the C++ code to pass the sizes as push constants to the shader. Differential Revision: [D66890825](https://our.internmc.facebook.com/intern/diff/D66890825/) [ghstack-poisoned]
2 parents 97f1806 + 4bbd67a commit 5a4de9d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backends/vulkan/test/vulkan_compute_api_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,7 @@ TEST(VulkanComputeGraphTest, test_simple_shared_objects_with_resize) {
16011601
auto addFn = VK_GET_OP_FN("aten.add.Tensor");
16021602
addFn(graph, {a.value, b.value, kDummyValueRef, c});
16031603

1604+
// no new allocations if binary op uses push constants
16041605
expected_vma_allocation_count += 0;
16051606
EXPECT_EQ(get_vma_allocation_count(), expected_vma_allocation_count);
16061607

@@ -1622,9 +1623,8 @@ TEST(VulkanComputeGraphTest, test_simple_shared_objects_with_resize) {
16221623
auto mulFn = VK_GET_OP_FN("aten.mul.Tensor");
16231624
mulFn(graph, {c, d.value, e});
16241625

1625-
// +2: alpha UBO, broadcast UBO for arithmetic shader
1626-
// +1: t.sizes_ubo() for arithmetic shader output e
1627-
expected_vma_allocation_count += 3;
1626+
// no new allocations if binary op uses push constants
1627+
expected_vma_allocation_count += 0;
16281628
EXPECT_EQ(get_vma_allocation_count(), expected_vma_allocation_count);
16291629

16301630
IOValueRef out = {};

0 commit comments

Comments
 (0)