Error adding OpenCV 3.0 OpenCL UMat

I'm trying to use the OpenCV API (3.0 beta) for OpenCL, but I have strange compilation errors for simple operations (at least for addition and subtraction).

Here's some sample code:

#include <opencv2/core.hpp>
#include <opencv2/core/ocl.hpp>
#include <iostream>

using namespace std;
using namespace cv;

Mat temp;

int main() {

    // activating opencl
    ocl::setUseOpenCL(true);

    UMat mat1 = UMat::ones(3,4,CV_32F);
    UMat mat2 = UMat::ones(3,4,CV_32F);
    UMat mat3;
    mat3 = mat1 + mat2;
    mat3.copyTo(temp);
    cout << "mat3 = " << endl << " " << temp << endl << endl;
}

      

I am getting this error:

/home/matthieu/git/stages/singapore/opencv_perf_tests/opencl_test.cpp: In function ‘int main()’:
/home/matthieu/git/stages/singapore/opencv_perf_tests/opencl_test.cpp:19:17: error: no match for ‘operator+’ (operand types are ‘cv::UMat’ and ‘cv::UMat’)
    mat3 = mat1 + mat2;
                ^

      

It's the same with subtraction. I cannot find anyone with the same error. Am I doing something wrong?

+3
c ++ opencv opencl gpgpu opencv3.0


source to share


No one has answered this question yet

Check out similar questions:

2116
Why are stigmental additions much faster in individual cycles than in combined cycles?
1399
What is undefined link / unresolved external symbol error and how to fix it?
8
Disable OpenCL in OpenCV completely
2
opencl and opencv 3.0 Beta
2
OpenCV 3 OpenCL UMat Functions
1
Instantiating OpenCL cl_mem using OpenCV UMat descriptor
1
openCV 3.0, openCL and meanShiftFiltering
1
UMAT Access Violation in OpenCV -3.0.0 / OpenCL
1
OpenCV 3.0 OpenCL UMat hangs in matchTemplate
0
How to load OpenCL buffer in OpenCV cv :: umat using Transparent API?



All Articles
Loading...
X
Show
Funny
Dev
Pics