Skip to content

Commit f7d82df

Browse files
pytorchbotSS-JIA
andauthored
[ET-VK][ez] Fix type ambiguity relating to TextureLimits class (#11646)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #11642 by @SS-JIA ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/SS-JIA/242/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/242/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/SS-JIA/242/orig @diff-train-skip-merge Co-authored-by: Stephen Jia <[email protected]>
1 parent 140cc14 commit f7d82df

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

backends/vulkan/runtime/api/containers/Tensor.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,7 @@ vTensor::vTensor(
615615
sizes_,
616616
whcn_dim_order,
617617
unsqueezed_strides,
618-
TextureLimits(
619-
calculate_logical_limits(storage_->image_extents_, axis_map_)),
618+
calculate_logical_limits(storage_->image_extents_, axis_map_),
620619
numel_});
621620
VK_CHECK_COND(
622621
dim_order_is_valid(dim_order_), "computed dim order is invalid");
@@ -648,10 +647,12 @@ vTensor::vTensor(
648647
uniforms_(),
649648
// Construct Tensor storage
650649
storage_(std::make_shared<vTensorStorage>(context, image)) {
651-
TextureLimits logical_limits(
652-
calculate_logical_limits(storage_->image_extents_, axis_map_));
653-
uniform_data_ = std::make_shared<UniformData>(
654-
UniformData{sizes_, {0, 0, 0, 0}, {0, 0, 0, 0}, logical_limits, numel_});
650+
uniform_data_ = std::make_shared<UniformData>(UniformData{
651+
sizes_,
652+
{0, 0, 0, 0},
653+
{0, 0, 0, 0},
654+
calculate_logical_limits(storage_->image_extents_, axis_map_),
655+
numel_});
655656
}
656657

657658
vTensor::vTensor(vTensor& other)
@@ -698,7 +699,7 @@ vTensor::vTensor(
698699
sizes_,
699700
create_whcn_dim_order(dim_order_),
700701
unsqueeze_strides(strides_, numel_),
701-
{other.logical_limits()},
702+
other.logical_limits(),
702703
static_cast<size_t>(utils::multiply_integers(sizes_))});
703704

704705
VK_CHECK_COND(

backends/vulkan/runtime/api/containers/Tensor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ class vTensor final {
167167
// component vector with components of size N must have base alignment of
168168
// 4N.
169169
alignas(16) utils::ivec3 limits;
170+
171+
TextureLimits(const utils::uvec3& ulimits) : limits{ulimits} {}
170172
};
171173

172174
public:
@@ -249,7 +251,7 @@ class vTensor final {
249251
const std::vector<int64_t>& sizes,
250252
const std::vector<int64_t>& whcn_dim_order,
251253
const std::vector<int64_t>& strides,
252-
const TextureLimits& logical_limits,
254+
const utils::uvec3& logical_limits,
253255
const size_t numel_ll)
254256
: sizes_v(utils::make_whcn_ivec4(sizes)),
255257
whcn_dim_order_v(utils::make_ivec4(whcn_dim_order)),

0 commit comments

Comments
 (0)