From bc67db9951d994ba2c8312db605e4842a123dabd Mon Sep 17 00:00:00 2001 From: zixianwei01 <1145922655@qq.com> Date: Tue, 6 Jan 2026 22:57:02 +0800 Subject: [PATCH] fix: build failure if with_vulkan --- modules/dnn/src/op_vkcom.cpp | 4 ++-- modules/dnn/src/vkcom/src/op_conv.cpp | 2 +- modules/dnn/src/vkcom/src/op_matmul.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/dnn/src/op_vkcom.cpp b/modules/dnn/src/op_vkcom.cpp index 84ffc9819d..f0ed384fd6 100644 --- a/modules/dnn/src/op_vkcom.cpp +++ b/modules/dnn/src/op_vkcom.cpp @@ -83,7 +83,7 @@ void copyToTensor(vkcom::Tensor &dst, const Mat &src) { CV_Assert(src.isContinuous() && src.type() == CV_32F); - std::vector mat_shape = shape(src); + std::vector mat_shape = shape(src).vec(); // The following code will copy the src data from CPU Mat to GPU VkBuffer. dst.reshape((const char*)src.data, mat_shape); @@ -168,7 +168,7 @@ VkComBackendWrapper::VkComBackendWrapper(const Ptr& baseBuffer, host = &m; tensor = base->tensor; CV_Assert(tensor.count() >= m.total()); - tensor.reshape(0, shape(m)); + tensor.reshape(0, shape(m).vec()); hostDirty = false; deviceDirty = false; } diff --git a/modules/dnn/src/vkcom/src/op_conv.cpp b/modules/dnn/src/vkcom/src/op_conv.cpp index 22aa537111..ed7fa7a823 100644 --- a/modules/dnn/src/vkcom/src/op_conv.cpp +++ b/modules/dnn/src/vkcom/src/op_conv.cpp @@ -84,7 +84,7 @@ OpConv::OpConv(const Mat& weightBlob, const std::vector& biasvec, int _ac // Create weightTensor Tensor weightTensor; CV_Assert(weightBlob.isContinuous() && weightBlob.type() == CV_32F); - std::vector matShape = shape(weightBlob); + std::vector matShape = shape(weightBlob).vec(); weightTensor.reshape((const char*)weightBlob.data, matShape); // This code will copy the src data from Mat to VkBuffer. weightTensorPtr = makePtr(weightTensor); diff --git a/modules/dnn/src/vkcom/src/op_matmul.cpp b/modules/dnn/src/vkcom/src/op_matmul.cpp index 479e64e5c8..2443976219 100644 --- a/modules/dnn/src/vkcom/src/op_matmul.cpp +++ b/modules/dnn/src/vkcom/src/op_matmul.cpp @@ -23,7 +23,7 @@ OpMatMul::OpMatMul(std::vector& matBlobs, const int _M, const int _K, const { Tensor weightTensor; CV_Assert(matBlobs[0].isContinuous() && matBlobs[0].type() == CV_32F); - std::vector matShape = shape(matBlobs[0]); + std::vector matShape = shape(matBlobs[0]).vec(); weightTensor.reshape((const char*)matBlobs[0].data, matShape); // This code will copy the src data from Mat to VkBuffer. weightTensorPtr = makePtr(weightTensor);