Skip to content
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

[ET-VK] Adding convenience functions in Compute graph to get PushConstantDataInfo for various attributes of a tensor. #7224

Open
wants to merge 8 commits into
base: gh/trivedivivek/23/base
Choose a base branch
from
23 changes: 23 additions & 0 deletions backends/vulkan/runtime/graph/ComputeGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <executorch/backends/vulkan/runtime/graph/containers/SharedObject.h>
#include <executorch/backends/vulkan/runtime/graph/containers/Value.h>

#include <executorch/backends/vulkan/runtime/graph/ops/DispatchNode.h>
#include <executorch/backends/vulkan/runtime/graph/ops/ExecuteNode.h>
#include <executorch/backends/vulkan/runtime/graph/ops/PrepackNode.h>

Expand Down Expand Up @@ -350,6 +351,28 @@ class ComputeGraph final {
return values_.at(idx).toTensor().logical_limits_ubo();
}

inline PushConstantDataInfo sizes_pc_of(const ValueRef idx) const {
return PushConstantDataInfo(
values_.at(idx).toConstTensor().get_uniform_data(), api::kTensorSizes);
}

inline PushConstantDataInfo strides_pc_of(const ValueRef idx) const {
return PushConstantDataInfo(
values_.at(idx).toConstTensor().get_uniform_data(),
api::kTensorStrides);
}

inline PushConstantDataInfo logical_limits_pc_of(const ValueRef idx) const {
return PushConstantDataInfo(
values_.at(idx).toConstTensor().get_uniform_data(),
api::kTensorLogicalLimits);
}

inline PushConstantDataInfo numel_pc_of(const ValueRef idx) const {
return PushConstantDataInfo(
values_.at(idx).toConstTensor().get_uniform_data(), api::kTensorNumel);
}

//
// Scalar Value Extraction
//
Expand Down
Loading