Fermat
Classes | Functions
Bits & Tricks

Detailed Description

This module provides several bit-manipulation functions.

Classes

struct  cugar::Bitmask< WORDS >
 
struct  cugar::Bitmask< 1 >
 
struct  cugar::Bitmask< 2 >
 
struct  cugar::morton_functor< Integer, DIM, BboxType >
 
struct  cugar::morton_functor< uint32, 2u, BboxType >
 
struct  cugar::morton_functor< uint64, 2u, BboxType >
 
struct  cugar::morton_functor< uint32, 3u, BboxType >
 
struct  cugar::morton_functor< uint64, 3u, BboxType >
 

Functions

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::morton_code (uint32 x, uint32 y)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::morton_code (uint32 x, uint32 y, uint32 z)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint64 cugar::morton_code60 (uint32 _x, uint32 _y)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint64 cugar::morton_code60 (uint32 x, uint32 y, uint32 z)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc (const int32 i)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc (const uint32 i)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc (const uint8 i)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc (const uint64 i)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::find_nthbit4 (const uint32 mask, const uint32 n)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc4 (const uint32 mask)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::find_nthbit8 (const uint32 mask, const uint32 n)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::ffs (const int32 x)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::lzc (const uint32 x)
 

Function Documentation

◆ ffs()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::ffs ( const int32  x)

find the least significant bit set

◆ find_nthbit4()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::find_nthbit4 ( const uint32  mask,
const uint32  n 
)

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

◆ find_nthbit8()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::find_nthbit8 ( const uint32  mask,
const uint32  n 
)

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

◆ lzc()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::lzc ( const uint32  x)

count the number of leading zeros

◆ morton_code() [1/2]

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::morton_code ( uint32  x,
uint32  y 
)

compute the Morton code of a given 2d point

Parameters
xx component
yy component

◆ morton_code() [2/2]

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::morton_code ( uint32  x,
uint32  y,
uint32  z 
)

compute the Morton code of a given 3d point

Parameters
xx component
yy component
zz component

◆ morton_code60() [1/2]

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint64 cugar::morton_code60 ( uint32  _x,
uint32  _y 
)

compute the 60-bit Morton code of a given 2d point

Parameters
_xx component
_yy component

◆ morton_code60() [2/2]

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint64 cugar::morton_code60 ( uint32  x,
uint32  y,
uint32  z 
)

compute the 60-bit Morton code of a given 3d point

Parameters
xx component
yy component
zz component

◆ popc() [1/4]

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc ( const int32  i)

int32 popcount

◆ popc() [2/4]

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc ( const uint32  i)

uint32 popcount

◆ popc() [3/4]

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc ( const uint8  i)

uint8 popcount

◆ popc() [4/4]

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc ( const uint64  i)

uint64 popcount

◆ popc4()

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 cugar::popc4 ( const uint32  mask)

compute the pop-count of 4-bit mask