Commit 245ff935 authored by Ilya Lavrenov's avatar Ilya Lavrenov

ocl setto fix for windows

parent c404da78
...@@ -362,8 +362,8 @@ static std::vector<uchar> cvt2(const cv::Scalar & s) ...@@ -362,8 +362,8 @@ static std::vector<uchar> cvt2(const cv::Scalar & s)
{ {
std::vector<uchar> _buf(sizeof(CLT)); std::vector<uchar> _buf(sizeof(CLT));
CLT * const buf = reinterpret_cast<CLT *>(&_buf[0]); CLT * const buf = reinterpret_cast<CLT *>(&_buf[0]);
buf->s0 = saturate_cast<PT>(s[0]); buf->s[0] = saturate_cast<PT>(s[0]);
buf->s1 = saturate_cast<PT>(s[1]); buf->s[1] = saturate_cast<PT>(s[1]);
return _buf; return _buf;
} }
...@@ -372,10 +372,10 @@ static std::vector<uchar> cvt4(const cv::Scalar & s) ...@@ -372,10 +372,10 @@ static std::vector<uchar> cvt4(const cv::Scalar & s)
{ {
std::vector<uchar> _buf(sizeof(CLT)); std::vector<uchar> _buf(sizeof(CLT));
CLT * const buf = reinterpret_cast<CLT *>(&_buf[0]); CLT * const buf = reinterpret_cast<CLT *>(&_buf[0]);
buf->s0 = saturate_cast<PT>(s[0]); buf->s[0] = saturate_cast<PT>(s[0]);
buf->s1 = saturate_cast<PT>(s[1]); buf->s[1] = saturate_cast<PT>(s[1]);
buf->s2 = saturate_cast<PT>(s[2]); buf->s[2] = saturate_cast<PT>(s[2]);
buf->s3 = saturate_cast<PT>(s[3]); buf->s[3] = saturate_cast<PT>(s[3]);
return _buf; return _buf;
} }
...@@ -428,7 +428,7 @@ static void set_to_withoutmask_run(const oclMat &dst, const Scalar &scalar, stri ...@@ -428,7 +428,7 @@ static void set_to_withoutmask_run(const oclMat &dst, const Scalar &scalar, stri
// run on OpenCL 1.1 platform if library binaries are compiled with OpenCL 1.2 support // run on OpenCL 1.1 platform if library binaries are compiled with OpenCL 1.2 support
if (Context::getContext()->supportsFeature(FEATURE_CL_VER_1_2) && dst.isContinuous()) if (Context::getContext()->supportsFeature(FEATURE_CL_VER_1_2) && dst.isContinuous())
{ {
std::vector<uchar> p = ::scalarToCLVector(scalar, dst.type()); std::vector<uchar> p = ::scalarToCLVector(scalar, CV_MAKE_TYPE(dst.depth(), dst.oclchannels()));
clEnqueueFillBuffer(getClCommandQueue(dst.clCxt), clEnqueueFillBuffer(getClCommandQueue(dst.clCxt),
(cl_mem)dst.data, (void*)&p[0], p.size(), (cl_mem)dst.data, (void*)&p[0], p.size(),
0, dst.step * dst.rows, 0, NULL, NULL); 0, dst.step * dst.rows, 0, NULL, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment