xref: /aosp_15_r20/external/executorch/backends/vulkan/runtime/graph/ops/utils/BindingUtils.h (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
11 #include <executorch/backends/vulkan/runtime/graph/ComputeGraph.h>
12 
13 namespace vkcompute {
14 
15 //
16 // For objects in the graph
17 //
18 
19 void bind_tensor_to_descriptor_set(
20     api::vTensor& tensor,
21     vkapi::PipelineBarrier& pipeline_barrier,
22     const vkapi::MemoryAccessFlags accessType,
23     vkapi::DescriptorSet& descriptor_set,
24     const uint32_t idx);
25 
26 uint32_t bind_values_to_descriptor_set(
27     ComputeGraph* graph,
28     const std::vector<ArgGroup>& args,
29     vkapi::PipelineBarrier& pipeline_barrier,
30     vkapi::DescriptorSet& descriptor_set,
31     const uint32_t base_idx);
32 
33 //
34 // For objects NOT in the graph
35 //
36 
37 uint32_t bind_params_to_descriptor_set(
38     const vkapi::ParamsBindList& params,
39     vkapi::DescriptorSet& descriptor_set,
40     const uint32_t base_idx);
41 
42 void bind_staging_to_descriptor_set(
43     api::StagingBuffer& staging,
44     vkapi::DescriptorSet& descriptor_set,
45     const uint32_t idx);
46 
47 } // namespace vkcompute
48