NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Typedefs
static.h File Reference
#include <functional>
#include <iterator>
#include <cfloat>
#include <typeinfo>
#include <vector>
#include <list>
#include <map>
#include <algorithm>
#include <cassert>
#include <memory>
#include <cmath>
#include <cstdio>
#include <cstdlib>

Go to the source code of this file.

Classes

struct  mgpu::sIsPow2< X >
 
struct  mgpu::sLogPow2< X, roundUp >
 
struct  mgpu::sLogPow2< 0, roundUp >
 
struct  mgpu::sLogPow2< 1, roundUp >
 
struct  mgpu::sDivUp< X, Y >
 
struct  mgpu::sDiv2RoundUp< count, levels >
 
struct  mgpu::sDiv2RoundUp< count, 0 >
 
struct  mgpu::sDivSafe< X, Y >
 
struct  mgpu::sDivSafe< X, 0 >
 
struct  mgpu::sRoundUp< X, Y >
 
struct  mgpu::sRoundDown< X, Y >
 
struct  mgpu::sIntegerDiv< X, Y >
 
struct  mgpu::sMax< X, Y >
 
struct  mgpu::sMin< X, Y >
 
struct  mgpu::sAbs< X >
 
struct  mgpu::sNumFactorsOf2< X, LSB >
 
struct  mgpu::sNumFactorsOf2< X, 1 >
 
struct  mgpu::sBankConflictDivisor< X, NumBanks >
 
struct  mgpu::sConflictFreeStorage< NT, X, NumBanks >
 

Namespaces

 mgpu
 

Macros

#define MGPU_MIN(x, y)   (((x) <= (y)) ? (x) : (y))
 
#define MGPU_MAX(x, y)   (((x) >= (y)) ? (x) : (y))
 
#define MGPU_MAX0(x)   (((x) >= 0) ? (x) : 0)
 
#define MGPU_ABS(x)   (((x) >= 0) ? (x) : (-x))
 
#define MGPU_DIV_UP(x, y)   (((x) + (y) - 1) / (y))
 
#define MGPU_DIV_ROUND(x, y)   (((x) + (y) / 2) / (y))
 
#define MGPU_ROUND_UP(x, y)   ((y) * MGPU_DIV_UP(x, y))
 
#define MGPU_SHIFT_DIV_UP(x, y)   (((x) + ((1<< (y)) - 1))>> y)
 
#define MGPU_ROUND_UP_POW2(x, y)   (((x) + (y) - 1) & ~((y) - 1))
 
#define MGPU_ROUND_DOWN_POW2(x, y)   ((x) & ~((y) - 1))
 
#define MGPU_IS_POW_2(x)   (0 == ((x) & ((x) - 1)))
 

Typedefs

typedef unsigned char mgpu::byte
 
typedef unsigned int mgpu::uint
 
typedef signed short mgpu::int16
 
typedef unsigned short mgpu::ushort
 
typedef unsigned short mgpu::uint16
 
typedef long long mgpu::int64
 
typedef unsigned long long mgpu::uint64
 

Macro Definition Documentation

#define MGPU_ABS (   x)    (((x) >= 0) ? (x) : (-x))

Definition at line 55 of file static.h.

#define MGPU_DIV_ROUND (   x,
 
)    (((x) + (y) / 2) / (y))

Definition at line 58 of file static.h.

#define MGPU_DIV_UP (   x,
 
)    (((x) + (y) - 1) / (y))

Definition at line 57 of file static.h.

#define MGPU_IS_POW_2 (   x)    (0 == ((x) & ((x) - 1)))

Definition at line 63 of file static.h.

#define MGPU_MAX (   x,
 
)    (((x) >= (y)) ? (x) : (y))

Definition at line 53 of file static.h.

#define MGPU_MAX0 (   x)    (((x) >= 0) ? (x) : 0)

Definition at line 54 of file static.h.

#define MGPU_MIN (   x,
 
)    (((x) <= (y)) ? (x) : (y))

Definition at line 52 of file static.h.

#define MGPU_ROUND_DOWN_POW2 (   x,
 
)    ((x) & ~((y) - 1))

Definition at line 62 of file static.h.

#define MGPU_ROUND_UP (   x,
 
)    ((y) * MGPU_DIV_UP(x, y))

Definition at line 59 of file static.h.

#define MGPU_ROUND_UP_POW2 (   x,
 
)    (((x) + (y) - 1) & ~((y) - 1))

Definition at line 61 of file static.h.

#define MGPU_SHIFT_DIV_UP (   x,
 
)    (((x) + ((1<< (y)) - 1))>> y)

Definition at line 60 of file static.h.