Fermat
Modules | Classes | Functions
Utilities

Detailed Description

CUGAR's convenience functions and functors needed for every day's work...

Modules

 Meta Functions
 

Classes

union  cugar::BinaryCast< Out, In >
 

Functions

template<uint32 N>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::lo_bits ()
 
template<uint32 N>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::hi_bits ()
 
template<typename Iterator , typename T >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::count_occurrences (const Iterator begin, uint32 size, const T val, const uint32 max_occ=uint32(-1))
 
template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::divide_ri (const L x, const R y)
 
template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::divide_rz (const L x, const R y)
 
template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::round_i (const L x, const R y)
 
template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::round_z (const L x, const R y)
 
template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::round (const L x, const R y)
 
template<typename Out , typename In >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Out cugar::binary_cast (const In in)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool cugar::is_pow2 (const uint32 C)
 
template<uint32 C>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool cugar::is_pow2_static ()
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::next_power_of_two (uint32 v)
 
template<uint32 N, typename I >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE I cugar::align (const I a)
 
template<uint32 N, typename I >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE I cugar::align_down (const I a)
 

Function Documentation

◆ binary_cast()

template<typename Out , typename In >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Out cugar::binary_cast ( const In  in)

a utility to perform binary casts between different types

◆ count_occurrences()

template<typename Iterator , typename T >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::count_occurrences ( const Iterator  begin,
uint32  size,
const T  val,
const uint32  max_occ = uint32(-1) 
)

count the number of occurrences of a given value inside an array, up to a maximum value

◆ divide_ri()

template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::divide_ri ( const L  x,
const R  y 
)
inline

x/y rounding towards +infinity for integers, used to determine # of blocks/warps etc.

◆ divide_rz()

template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::divide_rz ( const L  x,
const R  y 
)
inline

x/y rounding towards zero for integers, used to determine # of blocks/warps etc.

◆ hi_bits()

template<uint32 N>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::hi_bits ( )

return the bitmask with the hi N bits set

◆ lo_bits()

template<uint32 N>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::lo_bits ( )

return the bitmask with the lo N bits set

◆ round()

template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::round ( const L  x,
const R  y 
)
inline

round x towards to the closest multiple of x

◆ round_i()

template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::round_i ( const L  x,
const R  y 
)
inline

round x towards infinity to the next multiple of y

◆ round_z()

template<typename L , typename R >
CUGAR_HOST_DEVICE L cugar::round_z ( const L  x,
const R  y 
)
inline

round x towards zero to the next multiple of y