Skip to content

Commit

Permalink
Merge pull request opencv#3021 from ElenaGvozdeva:ocl_flip
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Jul 31, 2014
2 parents 2f2a9ad + 9db8592 commit 17a6b8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/core/src/copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,9 @@ static bool ocl_flip(InputArray _src, OutputArray _dst, int flipCode )
{
CV_Assert(flipCode >= -1 && flipCode <= 1);
int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type),
flipType, kercn = std::min(ocl::predictOptimalVectorWidth(_src, _dst), 4);;
flipType, kercn = std::min(ocl::predictOptimalVectorWidth(_src, _dst), 4);

if (cn > 4 || cn == 3)
if (cn > 4)
return false;

const char * kernelName;
Expand All @@ -631,7 +631,7 @@ static bool ocl_flip(InputArray _src, OutputArray _dst, int flipCode )

ocl::Device dev = ocl::Device::getDefault();
int pxPerWIy = (dev.isIntel() && (dev.type() & ocl::Device::TYPE_GPU)) ? 4 : 1;
kercn = std::max(kercn, cn);
kercn = (cn!=3 || flipType == FLIP_ROWS) ? std::max(kercn, cn) : cn;

ocl::Kernel k(kernelName, ocl::core::flip_oclsrc,
format( "-D T=%s -D T1=%s -D cn=%d -D PIX_PER_WI_Y=%d -D kercn=%d",
Expand Down

0 comments on commit 17a6b8c

Please sign in to comment.