mirror of
https://github.com/opencv/opencv.git
synced 2026-01-18 17:21:42 +01:00
Merge pull request #28376 from zixianwei01:fix-build-failure-if-turn-on-vkcom
dnn: Fix compilation errors when build with WITH_VULKAN option
This commit is contained in:
@@ -83,7 +83,7 @@ void copyToTensor(vkcom::Tensor &dst, const Mat &src)
|
||||
{
|
||||
CV_Assert(src.isContinuous() && src.type() == CV_32F);
|
||||
|
||||
std::vector<int> mat_shape = shape(src);
|
||||
std::vector<int> 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<BackendWrapper>& 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;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ OpConv::OpConv(const Mat& weightBlob, const std::vector<float>& biasvec, int _ac
|
||||
// Create weightTensor
|
||||
Tensor weightTensor;
|
||||
CV_Assert(weightBlob.isContinuous() && weightBlob.type() == CV_32F);
|
||||
std::vector<int> matShape = shape(weightBlob);
|
||||
std::vector<int> matShape = shape(weightBlob).vec();
|
||||
weightTensor.reshape((const char*)weightBlob.data, matShape); // This code will copy the src data from Mat to VkBuffer.
|
||||
|
||||
weightTensorPtr = makePtr<Tensor>(weightTensor);
|
||||
|
||||
@@ -23,7 +23,7 @@ OpMatMul::OpMatMul(std::vector<Mat>& matBlobs, const int _M, const int _K, const
|
||||
{
|
||||
Tensor weightTensor;
|
||||
CV_Assert(matBlobs[0].isContinuous() && matBlobs[0].type() == CV_32F);
|
||||
std::vector<int> matShape = shape(matBlobs[0]);
|
||||
std::vector<int> 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<Tensor>(weightTensor);
|
||||
|
||||
Reference in New Issue
Block a user