CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions | Variables
cms::cudacompat Namespace Reference

Classes

struct  CPUTraits
 
struct  GPUTraits
 
struct  HostTraits
 

Functions

template<typename T >
T __ldg (T const *x)
 
void __syncthreads ()
 
bool __syncthreads_and (bool x)
 
bool __syncthreads_or (bool x)
 
void __threadfence ()
 
template<typename T1 , typename T2 >
T1 atomicAdd (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicAdd_block (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicCAS (T1 *address, T1 compare, T2 val)
 
template<typename T1 , typename T2 >
T1 atomicCAS_block (T1 *address, T1 compare, T2 val)
 
template<typename T1 , typename T2 >
T1 atomicInc (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicInc_block (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicMax (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicMax_block (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicMin (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicMin_block (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicSub (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicSub_block (T1 *a, T2 b)
 

Variables

const dim3 blockDim = {1, 1, 1}
 
const dim3 blockIdx = {0, 0, 0}
 
const dim3 gridDim = {1, 1, 1}
 
const dim3 threadIdx = {0, 0, 0}
 

Function Documentation

template<typename T >
T cms::cudacompat::__ldg ( T const *  x)
inline
gpuVertexFinder::__syncthreads ( )
inline
bool cms::cudacompat::__syncthreads_and ( bool  x)
inline

Definition at line 111 of file cudaCompat.h.

Referenced by gpuClustering::for().

111 { return x; }
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
bool cms::cudacompat::__syncthreads_or ( bool  x)
inline

Definition at line 110 of file cudaCompat.h.

110 { return x; }
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
void cms::cudacompat::__threadfence ( )
inline

Definition at line 109 of file cudaCompat.h.

Referenced by GPUCACell::__attribute__().

109 {}
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicAdd ( T1 *  a,
T2  b 
)
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicAdd_block ( T1 *  a,
T2  b 
)

Definition at line 68 of file cudaCompat.h.

References atomicAdd().

68  {
69  return atomicAdd(a, b);
70  }
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
T1 atomicAdd(T1 *a, T2 b)
Definition: cudaCompat.h:61
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicCAS ( T1 *  address,
T1  compare,
T2  val 
)

Definition at line 36 of file cudaCompat.h.

Referenced by GPUCACell::__attribute__(), and atomicCAS_block().

36  {
37  T1 old = *address;
38  *address = old == compare ? val : old;
39  return old;
40  }
bool compare(const P &i, const P &j)
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicCAS_block ( T1 *  address,
T1  compare,
T2  val 
)

Definition at line 43 of file cudaCompat.h.

References atomicCAS().

43  {
44  return atomicCAS(address, compare, val);
45  }
bool compare(const P &i, const P &j)
T1 atomicCAS(T1 *address, T1 compare, T2 val)
Definition: cudaCompat.h:36
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicInc ( T1 *  a,
T2  b 
)

Definition at line 48 of file cudaCompat.h.

References a, and runTheMatrix::ret.

Referenced by gpuVertexFinder::__attribute__(), and atomicInc_block().

48  {
49  auto ret = *a;
50  if ((*a) < T1(b))
51  (*a)++;
52  return ret;
53  }
tuple ret
prodAgent to be discontinued
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicInc_block ( T1 *  a,
T2  b 
)

Definition at line 56 of file cudaCompat.h.

References atomicInc().

56  {
57  return atomicInc(a, b);
58  }
T1 atomicInc(T1 *a, T2 b)
Definition: cudaCompat.h:48
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicMax ( T1 *  a,
T2  b 
)

Definition at line 97 of file cudaCompat.h.

References a, SiStripPI::max, and runTheMatrix::ret.

Referenced by gpuPixelRecHits::__attribute__(), and atomicMax_block().

97  {
98  auto ret = *a;
99  *a = std::max(*a, T1(b));
100  return ret;
101  }
tuple ret
prodAgent to be discontinued
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicMax_block ( T1 *  a,
T2  b 
)

Definition at line 104 of file cudaCompat.h.

References atomicMax().

104  {
105  return atomicMax(a, b);
106  }
T1 atomicMax(T1 *a, T2 b)
Definition: cudaCompat.h:97
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicMin ( T1 *  a,
T2  b 
)

Definition at line 85 of file cudaCompat.h.

References a, min(), and runTheMatrix::ret.

Referenced by gpuPixelRecHits::__attribute__(), atomicMin_block(), and gpuVertexFinder::while().

85  {
86  auto ret = *a;
87  *a = std::min(*a, T1(b));
88  return ret;
89  }
tuple ret
prodAgent to be discontinued
T min(T a, T b)
Definition: MathUtil.h:58
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicMin_block ( T1 *  a,
T2  b 
)

Definition at line 92 of file cudaCompat.h.

References atomicMin().

92  {
93  return atomicMin(a, b);
94  }
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
T1 atomicMin(T1 *a, T2 b)
Definition: cudaCompat.h:85
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicSub ( T1 *  a,
T2  b 
)
template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicSub_block ( T1 *  a,
T2  b 
)

Definition at line 80 of file cudaCompat.h.

References atomicSub().

80  {
81  return atomicSub(a, b);
82  }
T1 atomicSub(T1 *a, T2 b)
Definition: cudaCompat.h:73
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119

Variable Documentation

const dim3 cms::cudacompat::blockDim = {1, 1, 1}
const dim3 cms::cudacompat::blockIdx = {0, 0, 0}
const dim3 cms::cudacompat::gridDim = {1, 1, 1}
const dim3 cms::cudacompat::threadIdx = {0, 0, 0}