cheshirekow
v0.1.0
|
inline functions for fast math involving powers of two More...
#include <climits>
Go to the source code of this file.
Namespaces | |
mpblocks | |
mpblocks::cuda | |
Functions | |
template<typename T > | |
T | mpblocks::cuda::divideBy2 (const T &x) |
returns x/2 (using bit shift), if x is odd then the result is floor(x/2) More... | |
template<typename T > | |
T | mpblocks::cuda::dividePow2 (T x, T y) |
returns x/y if x and y are both powers of two, otherwise the result is undefined More... | |
template<unsigned int I, typename T > | |
T | mpblocks::cuda::getBit (T x) |
returns the value of the specified bit More... | |
template<typename T > | |
T | mpblocks::cuda::intDivideRoundUp (T x, T y) |
integer divide with round up More... | |
template<typename T > | |
T | mpblocks::cuda::intPow (T x, T p) |
returns x to the power of p More... | |
template<typename T > | |
T | mpblocks::cuda::isEven (T x) |
returns true if the number is even More... | |
template<typename T > | |
T | mpblocks::cuda::isOdd (T x) |
returns true if the number is odd More... | |
template<typename T > | |
bool | mpblocks::cuda::isPow2 (T x) |
returns true if the parameter is an exact power of two More... | |
template<typename T > | |
T | mpblocks::cuda::log2 (T x) |
if x is a power of two then it returns the log of x with base 2 More... | |
template<typename T > | |
T | mpblocks::cuda::nextPow2 (T x) |
returns the smallest power of two that is not less than x More... | |
template<typename T > | |
T | mpblocks::cuda::prevPow2 (T x) |
returns the largest power of two that is not greater than x More... | |
template<typename T > | |
T | mpblocks::cuda::times2 (const T &x) |
returns x*2 (using bit shift) More... | |
template<typename T > | |
T | mpblocks::cuda::twoPow (T x) |
returns 2 to the power of x (2^x) More... | |
inline functions for fast math involving powers of two
Definition in file powersOfTwo.h.