mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 20:42:53 +08:00
core: divUp function
This commit is contained in:
parent
2e608b1c97
commit
9ca39821c8
@ -444,6 +444,23 @@ static inline size_t alignSize(size_t sz, int n)
|
|||||||
return (sz + n-1) & -n;
|
return (sz + n-1) & -n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @brief Integer division with result round up.
|
||||||
|
|
||||||
|
Use this function instead of `ceil((float)a / b)` expressions.
|
||||||
|
|
||||||
|
@sa alignSize
|
||||||
|
*/
|
||||||
|
static inline int divUp(int a, unsigned int b)
|
||||||
|
{
|
||||||
|
CV_DbgAssert(a >= 0);
|
||||||
|
return (a + b - 1) / b;
|
||||||
|
}
|
||||||
|
/** @overload */
|
||||||
|
static inline size_t divUp(size_t a, unsigned int b)
|
||||||
|
{
|
||||||
|
return (a + b - 1) / b;
|
||||||
|
}
|
||||||
|
|
||||||
/** @brief Enables or disables the optimized code.
|
/** @brief Enables or disables the optimized code.
|
||||||
|
|
||||||
The function can be used to dynamically turn on and off optimized code (code that uses SSE2, AVX,
|
The function can be used to dynamically turn on and off optimized code (code that uses SSE2, AVX,
|
||||||
|
@ -3406,11 +3406,6 @@ static TransposeInplaceFunc transposeInplaceTab[] =
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
static inline int divUp(int a, int b)
|
|
||||||
{
|
|
||||||
return (a + b - 1) / b;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool ocl_transpose( InputArray _src, OutputArray _dst )
|
static bool ocl_transpose( InputArray _src, OutputArray _dst )
|
||||||
{
|
{
|
||||||
const ocl::Device & dev = ocl::Device::getDefault();
|
const ocl::Device & dev = ocl::Device::getDefault();
|
||||||
|
@ -23,11 +23,6 @@ enum
|
|||||||
CTA_SIZE_DEFAULT = 256
|
CTA_SIZE_DEFAULT = 256
|
||||||
};
|
};
|
||||||
|
|
||||||
static int divUp(int a, int b)
|
|
||||||
{
|
|
||||||
return (a + b - 1) / b;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename FT, typename ST, typename WT>
|
template <typename FT, typename ST, typename WT>
|
||||||
static bool ocl_calcAlmostDist2Weight(UMat & almostDist2Weight,
|
static bool ocl_calcAlmostDist2Weight(UMat & almostDist2Weight,
|
||||||
int searchWindowSize, int templateWindowSize,
|
int searchWindowSize, int templateWindowSize,
|
||||||
|
Loading…
Reference in New Issue
Block a user