Skip to content

Commit

Permalink
Merge pull request opencv#3083 from akarsakov:ocl_transpose_check_locmem
Browse files Browse the repository at this point in the history
  • Loading branch information
vpisarev committed Aug 13, 2014
2 parents 01bd496 + 3deea1c commit 3cd7941
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/core/src/matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3002,6 +3002,13 @@ static bool ocl_transpose( InputArray _src, OutputArray _dst )
CV_Assert(dst.cols == dst.rows);
kernelName += "_inplace";
}
else
{
// check required local memory size
size_t required_local_memory = (size_t) TILE_DIM*(TILE_DIM+1)*CV_ELEM_SIZE(type);
if (required_local_memory > ocl::Device::getDefault().localMemSize())
return false;
}

ocl::Kernel k(kernelName.c_str(), ocl::core::transpose_oclsrc,
format("-D T=%s -D T1=%s -D cn=%d -D TILE_DIM=%d -D BLOCK_ROWS=%d -D rowsPerWI=%d",
Expand Down

0 comments on commit 3cd7941

Please sign in to comment.