NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Modules | Namespaces | Classes | Macros | Functions
Utilities

Detailed Description

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

Modules

 Functors
 
 Meta Functions
 
 VectorTypes
 

Namespaces

 nvbio::util
 

Classes

struct  nvbio::LCG_random
 
struct  nvbio::Field_traits< T >
 
struct  nvbio::Field_traits< int8 >
 
struct  nvbio::Field_traits< int16 >
 
struct  nvbio::Field_traits< int32 >
 
struct  nvbio::Field_traits< int64 >
 
union  nvbio::BinaryCast< Out, In >
 

Macros

#define NVBIO_RAND_A   1664525
 
#define NVBIO_RAND_C   1013904223
 

Functions

template<uint32 N>
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::util::lo_bits ()
 
template<uint32 N>
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::util::hi_bits ()
 
template<typename Iterator , typename T >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::util::count_occurrences (const Iterator begin, uint32 size, const T val, const uint32 max_occ=uint32(-1))
 
template<typename L , typename R >
NVBIO_HOST_DEVICEnvbio::util::divide_ri (const L x, const R y)
 
template<typename L , typename R >
NVBIO_HOST_DEVICEnvbio::util::divide_rz (const L x, const R y)
 
template<typename L , typename R >
NVBIO_HOST_DEVICEnvbio::util::round_i (const L x, const R y)
 
template<typename L , typename R >
NVBIO_HOST_DEVICEnvbio::util::round_z (const L x, const R y)
 
template<typename L , typename R >
NVBIO_HOST_DEVICEnvbio::util::round (const L x, const R y)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint8 
nvbio::comp (const uchar2 a, const char c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE char 
nvbio::comp (const char2 a, const char c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint8 
nvbio::comp (const uchar4 a, const char c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE char 
nvbio::comp (const char4 a, const char c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE signed char & 
nvbio::select (char4 &a, const char c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::comp (const uint2 a, const uint32 c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE void 
nvbio::set (uint2 &a, const uint32 c, const uint32 v)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint64 
nvbio::comp (const ulonglong2 a, const uint32 c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE void 
nvbio::set (ulonglong2 &a, const uint32 c, const uint64 v)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE int32 
nvbio::comp (const int2 a, const uint32 c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::comp (const uint4 a, const uint32 c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE void 
nvbio::set (uint4 &a, const uint32 c, const uint32 v)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE int32 
nvbio::comp (const int4 a, const uint32 c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 & 
nvbio::select (uint4 &a, const uint32 c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint16 
nvbio::comp (const ushort4 a, const uint32 c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint64 
nvbio::comp (const ulonglong4 a, const uint32 c)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE void 
nvbio::set (ulonglong4 &a, const uint32 c, const uint64 v)
 
template<typename T >
NVBIO_HOST_DEVICEnvbio::sgn (const T x)
 
NVBIO_HOST_DEVICE float nvbio::round (const float x)
 
NVBIO_HOST_DEVICE float nvbio::min (const float a, const float b)
 
NVBIO_HOST_DEVICE float nvbio::max (const float a, const float b)
 
NVBIO_HOST_DEVICE int8 nvbio::min (const int8 a, const int8 b)
 
NVBIO_HOST_DEVICE int8 nvbio::max (const int8 a, const int8 b)
 
NVBIO_HOST_DEVICE uint8 nvbio::min (const uint8 a, const uint8 b)
 
NVBIO_HOST_DEVICE uint8 nvbio::max (const uint8 a, const uint8 b)
 
NVBIO_HOST_DEVICE uint16 nvbio::min (const uint16 a, const uint16 b)
 
NVBIO_HOST_DEVICE uint16 nvbio::max (const uint16 a, const uint16 b)
 
NVBIO_HOST_DEVICE int32 nvbio::min (const int32 a, const int32 b)
 
NVBIO_HOST_DEVICE int32 nvbio::max (const int32 a, const int32 b)
 
NVBIO_HOST_DEVICE uint32 nvbio::min (const uint32 a, const uint32 b)
 
NVBIO_HOST_DEVICE uint32 nvbio::max (const uint32 a, const uint32 b)
 
NVBIO_HOST_DEVICE int64 nvbio::min (const int64 a, const int64 b)
 
NVBIO_HOST_DEVICE int64 nvbio::max (const int64 a, const int64 b)
 
NVBIO_HOST_DEVICE uint64 nvbio::min (const uint64 a, const uint64 b)
 
NVBIO_HOST_DEVICE uint64 nvbio::max (const uint64 a, const uint64 b)
 
NVBIO_HOST_DEVICE uint32 nvbio::quantize (const float x, const uint32 n)
 
float NVBIO_HOST_DEVICE nvbio::mod (const float x, const float m)
 
NVBIO_HOST_DEVICE uint32 nvbio::log2 (uint32 n)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::hash (uint32 a)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::hash2 (uint32 key)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint64 
nvbio::hash (uint64 key)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint64 
nvbio::hash2 (uint64 key)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint64 
nvbio::hash3 (uint64 key)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE float 
nvbio::radical_inverse (unsigned int n)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint8 
nvbio::min3 (const uint8 op1, const uint8 op2, const uint8 op3)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::min3 (const uint32 op1, const uint32 op2, const uint32 op3)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::max3 (const uint32 op1, const uint32 op2, const uint32 op3)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE int32 
nvbio::min3 (const int32 op1, const int32 op2, const int32 op3)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE int32 
nvbio::max3 (const int32 op1, const int32 op2, const int32 op3)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE float 
nvbio::min3 (const float op1, const float op2, const float op3)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE float 
nvbio::max3 (const float op1, const float op2, const float op3)
 
NVBIO_HOST_DEVICE float nvbio::fast_pow (const float a, const float b)
 
NVBIO_HOST_DEVICE float nvbio::fast_sin (const float x)
 
NVBIO_HOST_DEVICE float nvbio::fast_cos (const float x)
 
NVBIO_HOST_DEVICE float nvbio::fast_sqrt (const float x)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc (const int32 i)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc (const uint32 i)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc (const uint8 i)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::find_nthbit4 (const uint32 mask, const uint32 n)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc4 (const uint32 mask)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::find_nthbit8 (const uint32 mask, const uint32 n)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::ffs (const int32 x)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::lzc (const uint32 x)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc_2bit (const uint32 x, int c)
 
template<typename CountTable >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc_2bit_all (const uint32 b, const CountTable count_table)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::hibits_2bit (const uint32 mask, const uint32 i)
 
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc_2bit (const uint32 mask, int c, const uint32 i)
 
template<uint32 N>
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc_nbit (const uint32 x, int c)
 
template<uint32 N>
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::hibits_nbit (const uint32 mask, const uint32 i)
 
template<uint32 N>
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc_nbit (const uint32 mask, int c, const uint32 i)
 
template<typename CountTable >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::popc_2bit_all (const uint32 mask, const CountTable count_table, const uint32 i)
 
void nvbio::gen_2bit_count_table (uint32 *count_table)
 
template<typename Out , typename In >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE Out 
nvbio::binary_cast (const In in)
 
template<uint32 C>
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE bool 
nvbio::is_pow2 ()
 
template<uint32 N, typename I >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE I 
nvbio::align (const I a)
 
template<uint32 N, typename I >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE I 
nvbio::align_down (const I a)
 

Macro Definition Documentation

#define NVBIO_RAND_A   1664525

Definition at line 609 of file numbers.h.

#define NVBIO_RAND_C   1013904223

Definition at line 610 of file numbers.h.

Function Documentation

template<uint32 N, typename I >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE I nvbio::align ( const I  a)

Definition at line 283 of file types.h.

template<uint32 N, typename I >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE I nvbio::align_down ( const I  a)

Definition at line 287 of file types.h.

template<typename Out , typename In >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE Out nvbio::binary_cast ( const In  in)

a utility to perform binary casts between different types

Definition at line 267 of file types.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint8 nvbio::comp ( const uchar2  a,
const char  c 
)

return the c'th component of a by value

Definition at line 168 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE char nvbio::comp ( const char2  a,
const char  c 
)

return the c'th component of a by value

Definition at line 174 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint8 nvbio::comp ( const uchar4  a,
const char  c 
)

return the c'th component of a by value

Definition at line 181 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE char nvbio::comp ( const char4  a,
const char  c 
)

return the c'th component of a by value

Definition at line 189 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::comp ( const uint2  a,
const uint32  c 
)

return the c'th component of a by value

Definition at line 206 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint64 nvbio::comp ( const ulonglong2  a,
const uint32  c 
)

return the c'th component of a by value

Definition at line 219 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE int32 nvbio::comp ( const int2  a,
const uint32  c 
)

return the c'th component of a by value

Definition at line 232 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::comp ( const uint4  a,
const uint32  c 
)

return the c'th component of a by value

Definition at line 238 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE int32 nvbio::comp ( const int4  a,
const uint32  c 
)

return the c'th component of a by value

Definition at line 255 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint16 nvbio::comp ( const ushort4  a,
const uint32  c 
)

return the c'th component of a by value

Definition at line 272 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint64 nvbio::comp ( const ulonglong4  a,
const uint32  c 
)

return the c'th component of a by value

Definition at line 281 of file numbers.h.

template<typename Iterator , typename T >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::util::count_occurrences ( const Iterator  begin,
uint32  size,
const val,
const uint32  max_occ = uint32(-1) 
)

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

Definition at line 110 of file numbers.h.

template<typename L , typename R >
NVBIO_HOST_DEVICE L nvbio::util::divide_ri ( const x,
const y 
)
inline

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

Definition at line 128 of file numbers.h.

template<typename L , typename R >
NVBIO_HOST_DEVICE L nvbio::util::divide_rz ( const x,
const y 
)
inline

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

Definition at line 137 of file numbers.h.

NVBIO_HOST_DEVICE float nvbio::fast_cos ( const float  x)
inline

Definition at line 766 of file numbers.h.

NVBIO_HOST_DEVICE float nvbio::fast_pow ( const float  a,
const float  b 
)
inline

Definition at line 758 of file numbers.h.

NVBIO_HOST_DEVICE float nvbio::fast_sin ( const float  x)
inline

Definition at line 762 of file numbers.h.

NVBIO_HOST_DEVICE float nvbio::fast_sqrt ( const float  x)
inline

Definition at line 770 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::ffs ( const int32  x)

find the least significant bit set

Definition at line 207 of file popcount_inl.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::find_nthbit4 ( const uint32  mask,
const uint32  n 
)

find the n-th bit set in a 4-bit mask (n in [1,4])

Definition at line 91 of file popcount_inl.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::find_nthbit8 ( const uint32  mask,
const uint32  n 
)

find the n-th bit set in a 8-bit mask (n in [1,8])

Definition at line 114 of file popcount_inl.h.

void nvbio::gen_2bit_count_table ( uint32 *  count_table)
inline

Definition at line 138 of file popcount.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::hash ( uint32  a)

compute a simple 32-bit hash

Definition at line 536 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint64 nvbio::hash ( uint64  key)

Thomas Wang's 64 bit Mix Function: http://www.cris.com/~Ttwang/tech/inthash.htm

Definition at line 564 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::hash2 ( uint32  key)

Thomas Wang's 32 bit Mix Function: http://www.cris.com/~Ttwang/tech/inthash.htm

Definition at line 550 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint64 nvbio::hash2 ( uint64  key)

simple 64-bit hash

Definition at line 580 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint64 nvbio::hash3 ( uint64  key)

elf 64-bit hash

Definition at line 588 of file numbers.h.

template<uint32 N>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::util::hi_bits ( )

return the bitmask with the hi N bits set

Definition at line 103 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::hibits_2bit ( const uint32  mask,
const uint32  i 
)

given a 32-bit word encoding a set of 2-bit symbols, return a submask containing all but the first 'i' entries.

Definition at line 327 of file popcount_inl.h.

template<uint32 N>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::hibits_nbit ( const uint32  mask,
const uint32  i 
)

given a 32-bit word encoding a set of N-bit symbols, return a submask containing all but the first 'i' entries.

Definition at line 422 of file popcount_inl.h.

template<uint32 C>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE bool nvbio::is_pow2 ( )

Definition at line 279 of file types.h.

template<uint32 N>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::util::lo_bits ( )

return the bitmask with the lo N bits set

Definition at line 96 of file numbers.h.

NVBIO_HOST_DEVICE uint32 nvbio::log2 ( uint32  n)
inline

compute the log base 2 of an integer

Definition at line 515 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::lzc ( const uint32  x)

count the number of leading zeros

Definition at line 220 of file popcount_inl.h.

NVBIO_HOST_DEVICE float nvbio::max ( const float  a,
const float  b 
)
inline

maximum of two floats

Definition at line 445 of file numbers.h.

NVBIO_HOST_DEVICE int8 nvbio::max ( const int8  a,
const int8  b 
)
inline

maximum of two int8

Definition at line 453 of file numbers.h.

NVBIO_HOST_DEVICE uint8 nvbio::max ( const uint8  a,
const uint8  b 
)
inline

maximum of two uint8

Definition at line 461 of file numbers.h.

NVBIO_HOST_DEVICE uint16 nvbio::max ( const uint16  a,
const uint16  b 
)
inline

maximum of two uint16

Definition at line 469 of file numbers.h.

NVBIO_HOST_DEVICE int32 nvbio::max ( const int32  a,
const int32  b 
)
inline

maximum of two int32

Definition at line 477 of file numbers.h.

NVBIO_HOST_DEVICE uint32 nvbio::max ( const uint32  a,
const uint32  b 
)
inline

maximum of two uint32

Definition at line 485 of file numbers.h.

NVBIO_HOST_DEVICE int64 nvbio::max ( const int64  a,
const int64  b 
)
inline

maximum of two int64

Definition at line 493 of file numbers.h.

NVBIO_HOST_DEVICE uint64 nvbio::max ( const uint64  a,
const uint64  b 
)
inline

maximum of two uint64

Definition at line 501 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::max3 ( const uint32  op1,
const uint32  op2,
const uint32  op3 
)

Definition at line 707 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE int32 nvbio::max3 ( const int32  op1,
const int32  op2,
const int32  op3 
)

Definition at line 718 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE float nvbio::max3 ( const float  op1,
const float  op2,
const float  op3 
)

Definition at line 732 of file numbers.h.

NVBIO_HOST_DEVICE float nvbio::min ( const float  a,
const float  b 
)
inline

minimum of two floats

Definition at line 441 of file numbers.h.

NVBIO_HOST_DEVICE int8 nvbio::min ( const int8  a,
const int8  b 
)
inline

minimum of two int8

Definition at line 449 of file numbers.h.

NVBIO_HOST_DEVICE uint8 nvbio::min ( const uint8  a,
const uint8  b 
)
inline

minimum of two uint8

Definition at line 457 of file numbers.h.

NVBIO_HOST_DEVICE uint16 nvbio::min ( const uint16  a,
const uint16  b 
)
inline

minimum of two uint16

Definition at line 465 of file numbers.h.

NVBIO_HOST_DEVICE int32 nvbio::min ( const int32  a,
const int32  b 
)
inline

minimum of two int32

Definition at line 473 of file numbers.h.

NVBIO_HOST_DEVICE uint32 nvbio::min ( const uint32  a,
const uint32  b 
)
inline

minimum of two uint32

Definition at line 481 of file numbers.h.

NVBIO_HOST_DEVICE int64 nvbio::min ( const int64  a,
const int64  b 
)
inline

minimum of two int64

Definition at line 489 of file numbers.h.

NVBIO_HOST_DEVICE uint64 nvbio::min ( const uint64  a,
const uint64  b 
)
inline

minimum of two uint64

Definition at line 497 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint8 nvbio::min3 ( const uint8  op1,
const uint8  op2,
const uint8  op3 
)

Definition at line 695 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::min3 ( const uint32  op1,
const uint32  op2,
const uint32  op3 
)

Definition at line 701 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE int32 nvbio::min3 ( const int32  op1,
const int32  op2,
const int32  op3 
)

Definition at line 712 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE float nvbio::min3 ( const float  op1,
const float  op2,
const float  op3 
)

Definition at line 726 of file numbers.h.

float NVBIO_HOST_DEVICE nvbio::mod ( const float  x,
const float  m 
)
inline

compute the floating point module of a quantity with sign

Definition at line 511 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc ( const int32  i)

int32 popcount

Definition at line 42 of file popcount_inl.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc ( const uint32  i)

uint32 popcount

Definition at line 48 of file popcount_inl.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc ( const uint8  i)

uint8 popcount

Definition at line 83 of file popcount_inl.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc4 ( const uint32  mask)

compute the pop-count of 4-bit mask

Definition at line 103 of file popcount_inl.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc_2bit ( const uint32  x,
int  c 
)

count the number of occurrences of a given 2-bit pattern in a given word

Definition at line 239 of file popcount_inl.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc_2bit ( const uint32  mask,
int  c,
const uint32  i 
)

count the number of occurrences of a given 2-bit pattern in all but the first 'i' symbols of a 32-bit word mask.

Definition at line 343 of file popcount_inl.h.

template<typename CountTable >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc_2bit_all ( const uint32  b,
const CountTable  count_table 
)

count the number of occurrences of all 2-bit patterns in a given word, using an auxiliary table.

Parameters
count_tableauxiliary table to perform the parallel bit-counting for all integers in the range [0,255].
Returns
the 4 pop counts shifted and OR'ed together

Definition at line 266 of file popcount_inl.h.

template<typename CountTable >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc_2bit_all ( const uint32  mask,
const CountTable  count_table,
const uint32  i 
)

count the number of occurrences of all 2-bit patterns in all but the first 'i' symbols of a given word, using an auxiliary table.

Parameters
count_tableauxiliary table to perform the parallel bit-counting for all integers in the range [0,255].
Returns
the 4 pop counts shifted and OR'ed together

Definition at line 481 of file popcount_inl.h.

template<uint32 N>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc_nbit ( const uint32  x,
int  c 
)

count the number of occurrences of a given N-bit pattern in a given word

Definition at line 367 of file popcount_inl.h.

template<uint32 N>
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::popc_nbit ( const uint32  mask,
int  c,
const uint32  i 
)

count the number of occurrences of a given N-bit pattern in all but the first 'i' symbols of a 32-bit word mask.

Definition at line 450 of file popcount_inl.h.

NVBIO_HOST_DEVICE uint32 nvbio::quantize ( const float  x,
const uint32  n 
)
inline

quantize the float x in [0,1] to an integer [0,...,n[

Definition at line 505 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE float nvbio::radical_inverse ( unsigned int  n)

return the radical inverse of an integer n, useful for deterministic QMC sampling

Definition at line 628 of file numbers.h.

template<typename L , typename R >
NVBIO_HOST_DEVICE L nvbio::util::round ( const x,
const y 
)
inline

round x towards to the closest multiple of x

Definition at line 158 of file numbers.h.

NVBIO_HOST_DEVICE float nvbio::round ( const float  x)
inline

round a floating point number

Definition at line 433 of file numbers.h.

template<typename L , typename R >
NVBIO_HOST_DEVICE L nvbio::util::round_i ( const x,
const y 
)
inline

round x towards infinity to the next multiple of y

Definition at line 146 of file numbers.h.

template<typename L , typename R >
NVBIO_HOST_DEVICE L nvbio::util::round_z ( const x,
const y 
)
inline

round x towards zero to the next multiple of y

Definition at line 152 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE signed char& nvbio::select ( char4 &  a,
const char  c 
)

return a reference to the c'th component of a

Definition at line 197 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32& nvbio::select ( uint4 &  a,
const uint32  c 
)

return a reference to the c'th component of a

Definition at line 263 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::set ( uint2 &  a,
const uint32  c,
const uint32  v 
)

set the c'th component of a

Definition at line 212 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::set ( ulonglong2 &  a,
const uint32  c,
const uint64  v 
)

set the c'th component of a

Definition at line 225 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::set ( uint4 &  a,
const uint32  c,
const uint32  v 
)

set the c'th component of a

Definition at line 246 of file numbers.h.

NVBIO_FORCEINLINE NVBIO_HOST_DEVICE void nvbio::set ( ulonglong4 &  a,
const uint32  c,
const uint64  v 
)

set the c'th component of a

Definition at line 289 of file numbers.h.

template<typename T >
NVBIO_HOST_DEVICE T nvbio::sgn ( const x)
inline

sign function

Definition at line 429 of file numbers.h.