Functions | |
size_t | cu_size_min (size_t n, size_t m) |
size_t | cu_size_max (size_t n, size_t m) |
int | cu_size_cmp (size_t n, size_t m) |
size_t | cu_size_lmask (unsigned int b) |
size_t | cu_size_dcover (size_t x) |
size_t | cu_size_ucover (size_t x) |
size_t | cu_size_ceil_div (size_t n, size_t m) |
size_t | cu_size_mulceil (size_t n, size_t m) |
size_t | cu_size_mulfloor (size_t n, size_t m) |
size_t | cu_size_scal2ceil (size_t n, unsigned int b) |
size_t | cu_size_scal2floor (size_t n, unsigned int b) |
size_t | cu_size_alignceil (size_t n) |
size_t | cu_size_alignfloor (size_t n) |
size_t | cu_size_exp2ceil (size_t n) |
size_t | cu_size_exp2floor (size_t n) |
unsigned int | cu_size_floor_log2 (size_t n) |
unsigned int | cu_size_ceil_log2 (size_t n) |
unsigned int | cu_size_log2_lowbit (size_t n) |
ptrdiff_t | cu_ptrdiff_min (ptrdiff_t n, ptrdiff_t m) |
ptrdiff_t | cu_ptrdiff_max (ptrdiff_t n, ptrdiff_t m) |
ptrdiff_t | cu_ptrdiff_abs (ptrdiff_t n) |
ptrdiff_t cu_ptrdiff_abs | ( | ptrdiff_t | n | ) |
Returns the absolute value of n.
ptrdiff_t cu_ptrdiff_max | ( | ptrdiff_t | n, | |
ptrdiff_t | m | |||
) |
Returns the smallest argument.
ptrdiff_t cu_ptrdiff_min | ( | ptrdiff_t | n, | |
ptrdiff_t | m | |||
) |
Returns the greatest argument.
size_t cu_size_alignceil | ( | size_t | n | ) |
Round up n to the nearest fully aligned size.
size_t cu_size_alignfloor | ( | size_t | n | ) |
Round down n to the nearest fully aligned size.
size_t cu_size_ceil_div | ( | size_t | n, | |
size_t | m | |||
) |
Returns .
unsigned int cu_size_ceil_log2 | ( | size_t | n | ) |
Returns .
int cu_size_cmp | ( | size_t | n, | |
size_t | m | |||
) |
Returns -1 if n < m, 1 if n = m, and 0 otherwise.
size_t cu_size_dcover | ( | size_t | x | ) |
Returns a bitmask from the uppermost non-zero bit in x and downwards.
size_t cu_size_exp2ceil | ( | size_t | n | ) |
Returns , i.e. the smallest power of 2 which is greater or equal to n.
size_t cu_size_exp2floor | ( | size_t | n | ) |
Returns , i.e. the greatest power of 2 which is smaller or equal to n.
unsigned int cu_size_floor_log2 | ( | size_t | n | ) |
Returns .
size_t cu_size_lmask | ( | unsigned int | b | ) |
Returs a number with the lowest b bits set, and the remaining bits cleared.
unsigned int cu_size_log2_lowbit | ( | size_t | n | ) |
The exponent of the lowermost non-zero bit in n.
size_t cu_size_max | ( | size_t | n, | |
size_t | m | |||
) |
Returns the smallest argument.
size_t cu_size_min | ( | size_t | n, | |
size_t | m | |||
) |
Returns the greatest argument.
size_t cu_size_mulceil | ( | size_t | n, | |
size_t | m | |||
) |
Returns , i.e. n rounded up to the nearest multiple of m.
size_t cu_size_mulfloor | ( | size_t | n, | |
size_t | m | |||
) |
Returns , i.e. n rounded down to the nearest multiple of m.
size_t cu_size_scal2ceil | ( | size_t | n, | |
unsigned int | b | |||
) |
Returns , i.e. n rounded up to the nearest multiple of .
size_t cu_size_scal2floor | ( | size_t | n, | |
unsigned int | b | |||
) |
Returns , i.e. n rounded down to the nearest multiple of .
size_t cu_size_ucover | ( | size_t | x | ) |
Returns a bitmask from the lowermost non-zero bit in x and upwards.