};
try
{
- UMat u(1000, 1000, CV_32FC1);
+ UMat u(1000, 1000, CV_32FC1, Scalar::all(0));
parallel_for_(cv::Range(0, 2), TestParallelLoopBody(u));
}
catch (const cv::Exception& e)
{
try
{
- Mat m = Mat(1000, 1000, CV_8UC1);
+ Mat m = Mat(1000, 1000, CV_8UC1, Scalar::all(0));
UMat u = m.getUMat(ACCESS_READ);
UMat dst;
add(u, Scalar::all(0), dst); // start async operation
};
try
{
- Mat m = Mat(1000, 1000, CV_8UC1);
+ Mat m = Mat(1000, 1000, CV_8UC1, Scalar::all(0));
Logic l;
l.processData(m);
UMat result = l.getResult();
return;
}
std::cout << "Host memory: " << cv::ocl::Device::getDefault().hostUnifiedMemory() << std::endl;
- Mat m(Size(10, 10), CV_8UC1);
+ Mat m(Size(10, 10), CV_8UC1, Scalar::all(0));
UMat um = m.getUMat(ACCESS_RW);
{
Mat d1 = um.getMat(ACCESS_RW);
const int type = CV_8UC1;
const int dtype = CV_16UC1;
- Mat src(srcSize, type);
+ Mat src(srcSize, type, Scalar::all(0));
Mat dst_ref(srcSize, dtype);
// Generate reference data as additional check
// Use multiple iterations to increase chance of data race catching
for(int k = 0; k < 10000; k++)
{
- Mat src(srcSize, type); // Declare src inside loop now to catch its destruction on stack
+ Mat src(srcSize, type, Scalar::all(0)); // Declare src inside loop now to catch its destruction on stack
{
UMat tmpUMat = src.getUMat(ACCESS_RW);
tmpUMat.convertTo(dst, dtype);
bool exceptionDetected = false;
try
{
- UMat u(Size(10, 10), CV_8UC1);
+ UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
Mat m = u.getMat(ACCESS_READ);
UMat dst;
add(u, Scalar::all(1), dst);
bool exceptionDetected = false;
try
{
- UMat u(Size(10, 10), CV_8UC1);
+ UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
Mat m = u.getMat(ACCESS_READ);
add(u, Scalar::all(1), u);
}
bool exceptionDetected = false;
try
{
- UMat u(Size(10, 10), CV_8UC1);
+ UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
Mat m = u.getMat(ACCESS_WRITE);
UMat dst;
add(u, Scalar::all(1), dst);
bool exceptionDetected = false;
try
{
- UMat u(Size(10, 10), CV_8UC1);
+ UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
Mat m = u.getMat(ACCESS_WRITE);
add(u, Scalar::all(1), u);
}