packages/CudaUtils/cuda_utils/Functions.cc
//---------------------------------------------------------------------------//
/*!
 * \brief Round up to the nearest divisor, then divide
 *
 * This is useful for calculating block counts that, given a number of
 * threads per block (divisor) and a total thread count (dividend), ensures
 * that result * divisor >= dividend
 *
 * \param dividend Integer to be divided
 * \param divisor
 */
\brief Round up to the nearest divisor, then divide
This is useful for calculating block counts that, given a number of
threads per block (divisor) and a total thread count (dividend), ensures
that result * divisor >= dividend

\param dividend Integer to be divided
\param divisor
\ brief Round up to the nearest divisor then divide This is useful for calculating block counts that given a number of threads per block ( divisor ) and a total thread count ( dividend ) ensures that result * divisor > = dividend \ param dividend Integer to be divided \ param divisor
unsigned int ceil_quotient(unsigned int dividend, unsigned int divisor)
{
    REQUIRE(divisor > 0);
    unsigned int result = (dividend + divisor - 1) / divisor;
    ENSURE(result * divisor >= dividend);
    return result;
}
unsigned int ceil_quotient ( unsigned int dividend , unsigned int divisor ) { REQUIRE ( divisor > 0 ) ; unsigned int result = ( dividend + divisor - 1 ) / divisor ; ENSURE ( result * divisor >= dividend ) ; return result ; }
\brief Round up to the nearest divisor, then divide
 This is useful for calculating block counts that, given a number of
 threads per block (divisor) and a total thread count (dividend), ensures
 that result * divisor >= dividend
\ brief Round up to the nearest divisor then divide This is useful for calculating block counts that given a number of threads per block ( divisor ) and a total thread count ( dividend ) ensures that result * divisor > = dividend